These instructions help to create a demo setup for the Fractal-Circles-Integration with the Authentication part mocked by Keycloak.
The prototypical demo should be used to clarify open questions between Fractal and Circles.
- Java 11+
- Maven 3+
- Keycloak 14+
- Create Realm "circles"
- Create Client "verification"
- Set "Valid Redirect URL": http://localhost:8989/auth
- Set "Access-Type" to "Confidential"
- Copy "client_secret" from "Credentials" tab for later use
- Set "Create Protocol Mapper": "wallet-address"
- Set "Mapper Type": "User Attribute"
- Set "User Attribute", "Claim Name", "Token Claim Name": "wallet_address"
- Set "Claim JSON Type": "String"
- Create User "circles_user"
- Add attribute "wallet-address": "0x0523"
- Set non-temporary password for "circles_user"
- Set "client_secret" from Keycloak Client as
keycloak.client-secret
insrc/main/resources/application.properties
- Repo is cloned locally
- Keycloak is running at localhost:8080
- Keycloak configuration according to steps mentioned (Realm, Client, Users, Mappers)
- "client_secret" was added as
keycloak.client-secret
toapplication.properties
- Start Application with
mvn spring-boot:run
- Call Authentication URL Demo Setup: http://localhost:8080/auth/realms/circles/protocol/openid-connect/auth?client_id=verification&response_type=code&redirect_uri=http://localhost:8989/auth
- A successful service call (with successful login of user "circles_user" and redirect) will return the Bearer Token for user "circles_user". Use this Bearer Token for Authorization of the service at
/users/me
// Keycloak Bearer Token Request
GET http://localhost:8989/users/me
Authorization: Bearer ${BEARER_TOKEN}
The result should be the "wallet-address" stored with the "circles_user" in Keycloak.
-
Keycloak Mock