SecuredAuthenticationKey

SecuredAuthenticationKey[assoc]

represents a secured authentication key with credentials and details specified by the association assoc.

Details

  • SecuredAuthenticationKey is used to provide low-level OAuth credentials to various connections.
  • In SecuredAuthenticationKey[assoc], assoc has different requirements based on the version of OAuth.
  • SecuredAuthenticationKey is a symbolic representation of OAuth credentials used when making a connection; the credentials are not used until a connection is attempted.
  • OAuth 1.0a
  • For OAuth 1.0a, assoc must have the following keys:
  • "OAuthVersion""1.0a"
    "ConsumerKey"consumer key or application client ID
    "ConsumerSecret"consumer secret or application client secret
    "OAuthType"OAuth workflow type
    "RequestTokenURL"endpoint for temporary request tokens
    "AccessTokenURL"endpoint for access grant tokens
  • "OAuthType" supports the following workflows:
  • "OneLegged"sign a single request to access the service directly
    "TwoLegged"retrieve and use tokens to access the service
    "ThreeLegged"complete OAuth 1.0a spec workflow including user login
  • "AccessTokenURL" and "RequestTokenURL" support the following forms:
  • "url"URL giving the access token
    {"url","method"}specify the HTTP method, e.g. ("GET","POST",)
  • The following additional entries can also be given in the association:
  • "Name"Nonename for the SecuredAuthenticationKey
    "OAuthToken"Nonetoken for one-legged OAuth 1.0a
    "OAuthTokenSecret"Nonetoken secret for one-legged OAuth 1.0a
    "UserAuthorizationURL"Noneendpoint for user authorization
    "CallbackURL"AutomaticURL to send the user to after authorization
    "VerifierInputFunction"Automaticfunction that handles the authorization code
  • "CallbackURL" supports the following values:
  • Automatica page provided by Wolfram to display an OAuth verifier
    Inheriteda callback URL has been provided out of band (oob)
    "url"the URL of a custom callback page
  • "VerifierInputFunction" supports the following values:
  • Automaticprompts user to complete the workflow with a dialog
    "WolframConnectorChannel"use the Wolfram channel broker to complete the workflow
  • "SignatureMethod" supports the following key-generation, hash-algorithm pairs:
  • {"HMAC","MD2"}128-bit HMAC-MD2 signature
    {"HMAC","MD5"}128-bit HMAC-MD5 signature
    {"HMAC","SHA1"}160-bit HMAC-SHA1 signature
    {"HMAC","SHA256"}256-bit HMAC-SHA256 signature
    {"HMAC","SHA384"}384-bit HMAC-SHA384 signature
    {"HMAC","SHA512"}512-bit HMAC-SHA512 signature
  • Possible settings for "TransmissionMethod" include:
  • "Headers"all credentials are passed in the authorization headers
    "Query"all credentials are passed with URL query parameters
  • URL["url"] is also supported in the "RequestTokenURL", "AccessTokenURL", "UserAuthorizationURL" and "CallbackURL" fields.
  • OAuth 2.0
  • In SecuredAuthenticationKey[assoc], assoc must have the following keys:
  • "OAuthVersion"2.0
    "OAuthType"OAuth workflow type
    "ClientID"application client ID
    "ClientSecret"application client secret
    "AccessTokenURL"endpoint for access grant tokens
  • "OAuthType" supports the following workflows:
  • "ClientCredentials"client is acting on its own behalf
    "AuthorizationCode"retrieve and use tokens to access the service
  • The following additional keys can also be given in assoc:
  • "Name"Nonename for the SecuredAuthenticationKey
    "RedirectURI"AutomaticURI to send the user after authorization
    "Scopes"Nonelist of OAuth 2.0 scopes
    "TransmissionMethod""Headers"how credentials are passed during the workflow
    "UserAuthorizationURL"Noneendpoint for user authorization
    "VerifierInputFunction"Automaticfunction that handles the authorization code
  • "AccessTokenURL", "RequestTokenURL" and "UserAuthorizationURL" support the following forms:
  • "url"URL giving the access token
    {"url","method"}specify the HTTP method, e.g. ("GET","POST",)
  • "Scopes" supports the following values:
  • Noneno additional permissions requested from the user
    {"scope",}a list of permission scopes to request from the user
    {{"scope",},"scopeDelimiter"}a list of permission scopes with a nonstandard delimiter
  • "RedirectURI" supports the following values:
  • Automatica page provided by Wolfram to display an OAuth verifier
    "uri"the URI of a custom callback page
  • "VerifierInputFunction" supports the following values:
  • Automaticprompts user to complete the workflow with a dialog
    "WolframConnectorChannel"use the Wolfram channel broker to complete the workflow
  • Possible settings for "TransmissionMethod" include:
  • "Headers"all credentials are passed in the request headers
    "Body"all credentials are passed in the request body
  • URL["url"] is also supported in the "AccessTokenURL", "UserAuthorizationURL" and "RedirectURI" fields.

Examples

open allclose all

Basic Examples  (1)

Create a SecuredAuthenticationKey using the "AuthorizationCode" OAuth 2.0 workflow:

Execute a basic request using the authentication key:

Scope  (13)

Basic Uses  (2)

Create a basic SecuredAuthenticationKey:

Specify additional URL parameters such as "myParam" using URLBuild:

OAuth 1.0a  (5)

"One-Legged"  (1)

Create a SecuredAuthenticationKey using the "OneLegged" OAuth 1.0a workflow, typically used when OAuth tokens are already acquired:

Execute a basic request using the authentication key:

"Two-Legged"  (1)

Create a SecuredAuthenticationKey using the "TwoLegged" OAuth 1.0a workflow:

Execute the request on a basic API:

"Three-Legged"  (3)

Create a SecuredAuthenticationKey using the "ThreeLegged" OAuth 1.0a workflow:

Execute a basic request using the authentication key:

Deploy a custom page to display the verifier code:

Specify the redirect URI when using an OAuth 1.0a three-legged workflow:

Check that the key is working:

Use Inherited to create a SecuredAuthenticationKey where the callback URL has been established separately with the service or out of band:

OAuth 2.0  (6)

"AuthorizationCode"  (2)

Create a SecuredAuthenticationKey using the "AuthorizationCode" OAuth 2.0 workflow:

Execute a basic request using the authentication key:

Specify the redirect URI when using an OAuth 2.0 authorization code workflow:

"ClientCredentials"  (1)

Create a SecuredAuthenticationKey using the "ClientCredentials" OAuth 2.0 workflow:

"Scopes"  (2)

Specify additional permissions "Scopes":

Specify additional permissions "Scopes" using "+" as a delimiter:

"TransmissionMethod"  (1)

By default, client credentials are transmitted using HTTP authorization headers:

Use "TransmissionMethod""Body" to specify that authorization is provided as a part of the HTTP request body:

Wolfram Research (2017), SecuredAuthenticationKey, Wolfram Language function, https://reference.wolfram.com/language/ref/SecuredAuthenticationKey.html (updated 2019).

Text

Wolfram Research (2017), SecuredAuthenticationKey, Wolfram Language function, https://reference.wolfram.com/language/ref/SecuredAuthenticationKey.html (updated 2019).

CMS

Wolfram Language. 2017. "SecuredAuthenticationKey." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/SecuredAuthenticationKey.html.

APA

Wolfram Language. (2017). SecuredAuthenticationKey. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SecuredAuthenticationKey.html

BibTeX

@misc{reference.wolfram_2025_securedauthenticationkey, author="Wolfram Research", title="{SecuredAuthenticationKey}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/SecuredAuthenticationKey.html}", note=[Accessed: 21-February-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_securedauthenticationkey, organization={Wolfram Research}, title={SecuredAuthenticationKey}, year={2019}, url={https://reference.wolfram.com/language/ref/SecuredAuthenticationKey.html}, note=[Accessed: 21-February-2025 ]}