Reference Experience

Add a conversational interface to the Elastic Path platform by implementing this reference experience of an Amazon Lex chatbot. Learn how to integrate the Reference Chatbot with the React PWA Reference Storefront.

Generate a Public OAuth Token

Generate a Public OAuth Token

An access token is required for applications to access Cortex. To use the API or build an application that doesn't require the end user to create an account or authenticate, the client application should request a public access token. This access token enables access to resources that don't require a registered account.

Requesting an access token

Below is an example of the authentication workflow for requesting a PUBLIC access token from the client application's perspective.

Construct a POST request to the OAuth2 Resource and set the content-type to application/x-www-form-urlencoded

Using an access token

Once a token is granted, all subsequent requests to Cortex must include the access token in an Authorization request header. If the access token is invalid, does not exist in the Authorization request header, or the user does not have the authority to access a resource, Cortex returns a 401 status code

Add the access token to your request headers as shown in the example below: