Add Vizago to your application
# Install with npm
yarn install --save @vizago/vizago-js
# Install with yarn
yarn add @vizago/vizago-js
Include @vizago/vizago-js
with your build system or load it manually:
<script type="text/javascript" src="node_modules/@vizago/vizago-js/dist/vizago.js"></script>
Authenticate with WebAuthentication
Create a web authentication instance:
const vizago = new vizago.WebAuth({
domain: 'YOUR_DOMAIN',
clientID: 'YOUR_CLIENT_ID',
redirectUri: 'http://localhost:3000/callback',
responseType: 'token id_token',
scope: 'openid'
});
To login a user, call:
vizago.authorize();