Backend Integration
Java

OpenId Connect Spring Boot Example

This is a Spring Boot app to test the OpenID Connect Authorization Code flow.

Prerequisites

The application uses Spring, which includes Java SDK 1.8+ and Apache Maven 3.2+.

  1. You can download Java SDK from here Java (opens in a new tab)

  2. Install mvn

    For Mac OS use this command

    brew install maven

    For other OS

    Download from here Maven (opens in a new tab)

    If you want to know more about Maven just visit What is Maven (opens in a new tab)

App Setup

You can pull the source of this application using

git clone https://github.com/justpass-me/oidc-java

and start configuring the parameters of your keycloak in app/src/main/resources/application.yml.

- Make sure you replace `keycloak-client-id` and `keycloak-client-secret` with your keycloak configuration.

- Also provide appropriate `<TOKEN_URL>`, `<AUTHORIZATION_URL>` & `<USERINFO_URL>`.

Run the sample

Make sure you are in the directory that contains the pom.xml then run the package from your terminal with

    mvn spring-boot:run

Your app is available at http://localhost:8082 (opens in a new tab) and you should see the Login button. To begin the login process, click on it.

If you have any queries/you find any problems, please don't hesitate to raise an issue.


2024 © justpass.me