Agronod Keycloak Custom Claim Mapper

Requires - OpenJDK 17 or higher - maven

build

mvn clean package

deploy

Copy the jar file "custom_claim_mapper-1.0.jar" to Keycloaks providers directory /opt/keycloak/providers/

test on local docker

Change path in file start_keycloak_testing_container.sh to point to your custom_claim_mapper-1.0.jar file.

Then run

./start_keycloak_testing_container.sh

Once your container is up and running:

Alternativly running on local App:

  • set "Root URL": "http://localhost:3000" and "Valid redirect URIs": "http://localhost:3000/*" and "Web origins": *

  • Go to http://localhost:3000

  • Create client scope "agro-id"

  • Add Mapper (Configure new mapper) in scope "agro-id"

  • Select "Agronod Custom Claim Mapper" and name it "agronodclaimmapper"

  • In "myclient" add client scope "agro-id" as default

To run shell in keycloak container.

docker exec -it keycloak-testing-container sh