Secure Spring Micro services and Angular Apps using Oauth2 OIDC with Keycloak

đź“šPrerequisite

Java Spring

âť•About This Repo

IIn this set of tasks, the goal is to set up and configure Keycloak, an open-source identity and access management solution. The process is detailed in several steps:

  • Firstly, you need to download Keycloak version 19 from the official Keycloak website. Once downloaded, you can initiate Keycloak on your local machine or server.

  • After launching Keycloak, the next step involves creating an administrative account. This account will be essential for managing and configuring Keycloak settings.

  • Following the administrative setup, the creation of a realm is required. A realm in Keycloak serves as a security domain, facilitating the management of clients, users, and roles within a specific context.

  • Partie 1 : 1. TĂ©lĂ©charger Keycloak 19 2. DĂ©marrer Keycloak 3. CrĂ©er un compte Admin 4. CrĂ©er une Realm 5. CrĂ©er un client Ă  sĂ©curiser 6. CrĂ©er des utilisateurs 7. CrĂ©er des rĂ´les 8. Affecter les rĂ´les aux utilisateurs 9. Avec PostMan :
    • Tester l'authentification avec le mot de passe
    • Analyser les contenus des deux JWT Access Token et Refresh Token
    • Tester l'authentification avec le Refresh Token
    • Tester l'authentification avec Client ID et Client Secret
    • Changer les paramètres des Tokens Access Token et Refresh Token

Discover KeyCloak Space

Alt text

Create Realm

Alt text

Create Users

Alt text

Create Roles

Alt text

Assign Roles to users

Alt text


Test Phase With Postmane

Get token

Alt text

We can Display the content of this token by acceding to this :https://jwt.io/

Alt text

Recieve New token through sending refresh_token

  • To do that we will copy the refresh token shown above and we will send a new query to the token service Alt text