SecuredAuthenticationKey

SecuredAuthenticationKey[assoc]

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

Details

  • SecuredAuthenticationKey is a symbolic representation of OAuth credentials used in an authentication process; it does not itself perform authentication.
  • In SecuredAuthenticationKey[assoc], assoc has different requirements based on the version of OAuth.
  • OAuth 1.0a
  • For OAuth 1.0a, assoc must have the following components:
  • "OAuthVersion""1.0a"
    "ConsumerKey"consumer key or application client ID
    "ConsumerSecret"consumer secret or application client secret
    "OAuthType"OAuth workflow type ("OneLegged", "TwoLegged", )
    "RequestTokenURL"endpoint for temporary request tokens
    "AccessTokenURL"endpoint for access grant tokens
  • 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 completing authorization
    "VerifierInputFunction"Automaticfunction that returns the OAuth verifier to complete the workflow
  • "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
  • "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 components:
  • "OAuthVersion"2.0
    "OAuthType"OAuth workflow type ("TwoLegged", "ThreeLegged")
    "AccessTokenURL"endpoint for access grant tokens
  • The following additional entries can also be given in the association:
  • "Name"Nonename for the SecuredAuthenticationKey
    "ClientCredentials"Noneapplication credentials
    "UserAuthorizationURL"Noneendpoint for user authorization
    "CallbackURL"AutomaticURL to send the user to after completing authorization
    "VerifierInputFunction"Automaticfunction that returns the OAuth verifier to complete the workflow
    "Scopes"Nonelist of OAuth 2.0 scopes
    "State"AutomaticOAuth 2.0 CSRF state parameter
    "ResponseType""code"OAuth 2.0 response type
    "ScopeDelimiter"Nonecharacter to delimit scopes
    "AdditionalParameters"Nonenonstandard additional request parameters
    "AdditionalResponseParameters"Noneadditional response parameters to be stored
  • "ClientCredentials" is an association with the following components:
  • "ConsumerKey"consumer key or application client ID
    "ConsumerSecret"consumer secret or application client secret
  • "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
  • In OAuth 2.0, "CallbackURL" is also known as a redirect URI.
  • "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:
  • "Query"all credentials are passed in the query parameters
    "Body"all credentials are passed in the body parameters
  • "AdditionalParameters" is specified by giving the following components in an association:
  • "AccessRequest"list of key-value pairs to send as additional parameters with the access request
    "AuthorizationRequest"
  • list of key-value pairs to send as additional parameters with the authorization request
  • "AdditionalResponseParameters" is specified by giving the following components in an association:
  • "AccessRequest"list of keys to receive as additional parameters with the access request response
    "AuthorizationRequest"
  • list of keys to receive as additional parameters with the authorization request response
  • "AdditionalResponseParameters" values are stored in $SecuredAuthenticationKeyTokens.
  • URL["url"] is also supported in the "AccessTokenURL", "UserAuthorizationURL" and "CallbackURL" fields.

Examples

open allclose all

Basic Examples  (6)

Create a SecuredAuthenticationKey to authenticate a call to a sample API using one-legged OAuth 1.0a:

Create a SecuredAuthenticationKey to authenticate a call to a sample API using two-legged OAuth 1.0a:

Create a SecuredAuthenticationKey to authenticate a call to Flickr's test API using three-legged OAuth 1.0a. Use your Flickr consumer key and secret to evaluate the example properly:

Check that the key is working:

Create a SecuredAuthenticationKey with credentials from an external service, using two-legged OAuth 1.0a:

Use the key to send signed requests to a service:

Create a SecuredAuthenticationKey to authenticate a call to Twitter's API using two-legged OAuth 2.0. Use your Twitter consumer key and secret to evaluate the example properly:

Check that the key is working:

Create a SecuredAuthenticationKey to authenticate a call to LinkedIn's API using three-legged OAuth 2.0. Use your LinkedIn consumer key and secret to evaluate the example properly:

Check that the key is working:

Scope  (28)

AccessTokenURL  (2)

Specify the access token URL when using an OAuth 2.0 two-legged workflow:

Specify the access token URL when using an OAuth 2.0 three-legged workflow:

AdditionalParameters  (3)

Specify additional parameters to be sent to the server along with the authorization request:

Specify additional parameters to be sent to the server along with the access request:

Specify additional parameters to be sent to the server along with the authorization and access requests:

AdditionalResponseParameters  (3)

Specify additional response parameters to be received from the server along with the authorization request response:

Specify additional response parameters to be received from the server along with the access request response:

Specify additional response parameters to be received from the server along with the authorization and access request responses:

CallbackURL  (2)

URL  (1)

Deploy a custom page to display the verifier code:

Use the URL in the SecuredAuthenticationKey. Use your Flickr consumer key and secret to evaluate the example properly:

Check that the key is working:

Inherited  (1)

Use Inherited to create a SecuredAuthenticationKey where the callback URL has been established separately with the service, or out of band. Use your Twitter consumer key and secret to evaluate the example properly:

ClientCredentials  (1)

Define the client credentials for the SecuredAuthenticationKey by providing an association with the consumer key and consumer secret:

Name  (1)

Define a custom name for the SecuredAuthenticationKey:

OAuthToken  (1)

Specify the OAuth token when using an OAuth 1.0a one-legged workflow:

OAuthTokenSecret  (1)

Specify the OAuth token secret when using an OAuth 1.0a one-legged workflow:

RedirectURI  (1)

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

RequestTokenURL  (1)

Specify the request token URL when using an OAuth 1.0a two-legged workflow:

ResponseType  (1)

Specify the response type for the server's response to user authorization:

ScopeDelimiter  (1)

Use an ampersand as a scope delimiter

Scopes  (1)

Specify the required service scopes for the key:

SignatureMethod  (1)

Use an HMAC-SHA256 signature method to sign the OAuth 1.0a authentication request:

State  (1)

Create a key with a custom state string:

TransmissionMethod  (3)

Use the request body to send the parameters of the OAuth 2.0 authentication:

Use the request query string to send the parameters of the OAuth 2.0 authentication:

Use the request headers to send the parameters of the OAuth 1.0a authentication:

UserAuthorizationURL  (1)

Specify a LinkedIn user's authorization URL for three-legged OAuth:

VerifierInputFunction  (3)

OAuth 1.0a  (1)

Create a key that uses a custom VerifierInputFunction. Use your Flickr consumer key and secret to evaluate the example properly:

OAuth 2.0  (2)

Create a key that uses a custom VerifierInputFunction. Use your Reddit consumer key and secret to evaluate the example properly:

Create a key that uses the Wolfram Cloud channel broker as a VerifierInputFunction. Use your Reddit consumer key and secret to evaluate the example properly:

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_2024_securedauthenticationkey, author="Wolfram Research", title="{SecuredAuthenticationKey}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/SecuredAuthenticationKey.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

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