Skip to content

Instantly share code, notes, and snippets.

@ankkal
Created July 23, 2018 05:18
Show Gist options
  • Save ankkal/53361bb5ba7ef6bc601f44a49ec4de6c to your computer and use it in GitHub Desktop.
Save ankkal/53361bb5ba7ef6bc601f44a49ec4de6c to your computer and use it in GitHub Desktop.
Field Description
Do you allow users to create an account or link to an existing account with you? Select this to enable account linking for a custom skill.
Authorization Grant Type The OAuth 2.0 authorization grant to use to obtain the access token. Select Auth Code Grant.
Authorization URI The URI for a page the user can use to log into your service. The Alexa app displays this page when the user begins the account linking process. In our case it is the Cognito AUTHORIZATION Endpoint which provides a hosted UI. Provide the URL as per below
https://[your-cognito-domain]/oauth2/authorize?response_type=code&client_id=[your-client-id]&redirect_uri=https://pitangui.amazon.com/api/skill/link/[vendor-id-amazon-gives-you]&state=STATE
Note:
*Replace your-cognito-domain with the cognito domain name from “App integration > domain Name” section in your cognito user pool admin page.
*Replace your-client-id with client id from “General settings > App clients” section in your cognito user pool admin page.
Access Token URI The URI for the access token endpoint for your Cognito user pool.
The Alexa service calls this URI to exchange the authorization code for an access token . Alexa also calls this URI with the refresh token to get a new access token when the previous token expires.
https://[your-cognito-domain]/oauth2/token?state=STATE
Note:
*Replace your-cognito-domain with the cognito domain name from “App integration > domain Name” section in your cognito user pool admin page.
Client ID The Client Id is also part of the client credentials that the Alexa service includes when requesting an access token from the Access Token URI.
You can get this from “General settings->App clients” section in your Cognito user pool admin page.
Client Secret A credential you provide that lets the Alexa service authenticate with the Access Token URI. This is combined with the Client ID to identify the request as coming from Alexa.
*This value is available at “General settings > App clients” section in your cognito user pool admin page in App client secret field.
Client Authentication Scheme Identifies the type of authentication Alexa should use when requesting tokens from the Access Token URI. Keep it as default “Credentials in request body”
Scope Add scopes as phone and openid
Domain List Keep Default
Default Access Token Expiration Time The time in seconds for which the access token is valid. This value is used if the OAuth client does not return expires_in. If the OAuth client returns expires_in, the value provided by the OAuth client is used instead.
Redirect URLs This displays the Amazon-provided redirection endpoints to which your login page must redirect the user after the user is authenticated. The value to use for a given request is passed to your login page as the redirect_uri parameter included with the authorization URI. See Redirection Endpoints.You also need to configure these url on Amazon Cognito user pool as callback url.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment