This is a demo project to show how to create a Singpass resource server using Spring Boot with Gradle with the client assertion flow.
- JDK 23
- Gradle 8.12.1
- Prepare environment variables:
SINGPASS_CLIENT_ID=
SINGPASS_REDIRECT_URL=
SINGPASS_ISSUER_URL=
SINGPASS_PUBLIC_JWKS_URL=
SINGPASS_SCOPE=
SINGPASS_JWKS_SECRET=
This variable will be used in the application.yaml file.
- Frontend application redirects user to Singpass login page.
- User logs in with Singpass.
- Singpass redirects user back to frontend application with an authorization code.
- Frontend application sends the authorization code to the backend.
- Backend application exchanges the authorization code for an access token.
- Backend application uses the access token to access Singpass resources.
- Singpass returns the user's data to the backend application.
/api/v1/oidc/auth
- This endpoint will redirect the user to the Singpass login page./api/v1/oidc/token
- This endpoint will exchange the authorization code for an access token.
- Clone this repository.
- Run the application.
- Access
http://localhost:8080
to start the server