This repository contains a JavaScript example application that demonstrates the implicit flow for OpenID Connect.
- Clone / Download the repository
- Extract the zip or navigate to the home directory.
- You can customize the details relevant to the OIDC in the
./index.html
file. - Make sure that you replace the
keycloak-tenant-id
with your TenantID andkeycloak-client-id
clientID from your keycloak. - Modify
{hostname}
to align your keycloak domain. - Need to install http-server, to act as localhost to the
index.html
. - RUN
npm i http-server -g
as the global package to installhttp-server
. - Upon installation of
http-server
, RUNhttp-server
in the same terminal, referring/pointing to the root folder that has theindex.html
file. - You will receive a localhost URL, open that particular URL in your browser, to view your initial screen.
Starting up http-server -p <PORT_NUMBER>, serving ./
Available on:
http://127.0.0.1:<PORT_NUMBER>
Hit CTRL-C to stop the server
- Click on "login" button.
- You will be redirected to the user authentication screen of "Keycloak".
- Complete all of the authentication steps.
- Depending on the response type you configured, you will receive a token.
OpenID Connect is a perfect way to incorporate user authentication to your application, where you are relying on another party to handle user identity.
In this situation, Keycloak handles the identity of the users, allowing it faster to get up and running.
By integrating OpenID Connect via Keycloak, you are building a session that can be used to single sign-on from your custom app to other applications that your users can access via the Keycloak portal.
If you have any queries/you find any problems, please don't hesitate to raise an issue