Skip to content

Instantly share code, notes, and snippets.

@quiaro
Created November 10, 2017 17:45
Show Gist options
  • Select an option

  • Save quiaro/b4c4bb9cb91cae04213e0b2cb367bdce to your computer and use it in GitHub Desktop.

Select an option

Save quiaro/b4c4bb9cb91cae04213e0b2cb367bdce to your computer and use it in GitHub Desktop.
Authenticate via Auth0 Authentication API
import auth0 from 'auth0-js';
const CLIENT_DOMAIN = '__AUTH0_DOMAIN__';
const CLIENT_ID = '__AUTH0_CLIENT_ID__';
const SCOPE = 'openid';
const REDIRECT = 'http://localhost:3000/callback';
const auth = new auth0.WebAuth({
domain: CLIENT_DOMAIN,
clientID: CLIENT_ID,
});
export function login() {
auth.authorize({
responseType: 'token',
redirectUri: REDIRECT,
scope: SCOPE,
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment