-
Notifications
You must be signed in to change notification settings - Fork 1
JS Console
The Keycloak team provides many implementation examples as a seperate download. In this section, we will use a modified version of their js-console example to view information about the tokens Keycloak provides. For this, step, download the keycloak-example file at http://downloads.jboss.org/keycloak/1.9.1.Final/keycloak-examples-1.9.1.Final.zip.
###Setup a New Client Login to the administration console and create a new client. The Client ID should be js-console. Use the following for the client fields.
Valid Redirect URIs: http://localhost:8181/js-console/*
Base URL: http://localhost:8181/js-console/
Web Origins: +
Next, click on your Installations tab and grab the keycloak.json.
###Update keycloak.json, Build, and Deploy This project creates a landing page with which to demonstrate some of the Keycloak api functions with the javascript adapter. As such, the only modification needed is to update the keycloak.json and to update the index.html to point to http://localhost:8080/auth/js/keycloak.js. This uses the js-console project in the examples folder. Update the keycloak.json file in this project, then build and deploy it. After deployment, visit http://localhost:8181/js-console/
Use the various buttons to look at the available token and user data.
Get Profile will show you the basic account data for the user such as their enabled status, whether they have totp enabled, or if they've verified their email.
Get User Info will return the user information that they entered, such as names and email addresses.
Get Token is an important endpoint as it shows the Bearer token for the user. It also gives out information on the clients that the user has access to as well as the roles they're permitted in those clients.
Get ID Token shows the other token given in an OpenID Connect, the ID token.