This project demonstrates how Token Auth works with Edgio. For more details on this feature, visit the docs.
This application exposes a few separate pages and one API endpoint:
- Main Page
/
: This page does not require a token. - Token Auth Landing Page
/secure
: This page does not require a token. All links on this page require a valid token. - Static Secure Page
/secure/static
: This page shows static data. - Static Dynamic Page
/secure/dynamic
: This page shows dynamic data fetched from a third-party API. - Token Generator/Decoder
/secure/generator
: This page allows the visitor to create and decodeectoken
-compatible tokens. - Current Token Information
/secure/info
: This page shows the decoded information about the token used to access the page. - API route
/api/token
: This API route takes aGET
request and returns a new token valid for all users but only for three minutes from when it was generated.
- Navigate to the project homepage and click the link for the "Landing Page."
- On the landing page, click the button to "Generate a temporary token."
- Copy the generated token to your clipboard. Note that the links on this page will automatically update when a token is generated.
- If you have generated a token via the client-side generator (see below), you can replace the token in the query string for any of the secure routes.
You can also generate a custom token for this site. (Please note: the primary and backup tokens must be present in the Edgio environment variables for this feature to work properly.)
- Navigate to the "Client-side Token Generator/Decoder" page.
- Under the "Encode Token" section, enter the values you need for your token.
- In that same section, enter one of the two keys you entered in your Token Auth settings for your Edgio environment.
- Click "Encode Token."
- The "Token value" field will contain the encoded token for your environment. Copy that token, and use it when navigating the demo site.