Created
November 15, 2017 17:35
-
-
Save quiaro/b676ce06e062f1cc364bf4d6c76b3927 to your computer and use it in GitHub Desktop.
Get ID token when authenticating via Auth0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import auth0 from 'auth0-js'; | |
| const CLIENT_DOMAIN = '__AUTH0_DOMAIN__'; | |
| const CLIENT_ID = '__AUTH0_CLIENT_ID__'; | |
| const SCOPE = 'openid email'; | |
| const REDIRECT = 'http://localhost:3000/callback'; | |
| const auth = new auth0.WebAuth({ | |
| domain: CLIENT_DOMAIN, | |
| clientID: CLIENT_ID, | |
| }); | |
| export function login() { | |
| auth.authorize({ | |
| responseType: 'id_token', | |
| redirectUri: REDIRECT, | |
| scope: SCOPE, | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment