This custom claim handler will add some external claims to the id token
- Stop the server if it is already running
- Build the project using following command
mvn clean install
- Copy the jar file org.wso2.custom.claimhandler-1.0-SNAPSHOT.jar from the target directory to <IS_HOME>/repository/components/dropins folder
- Change the default claim handler configuration in application-authentication.xml as follows.
<ClaimHandler>org.wso2.custom.claim.handler.CustomClaimHandler</ClaimHandler>
- Start the server
- Create custom local claim called
http://test.wso2.org/claims/keplerNumber
and mapped to an attribute which is available in your user store. - Then mapped this claims to an oidc claim.
- Don’t forget to add the oidc claims to the registry.
- Add a service provider by selecting the requested claim as "http://test.wso2.org/claims/keplerNumber"
- Get an id token for this service provider
- Pasre the id token using [1], now you could able to see the claim keplerNumber as a json attribute.
Refer [2] understand the implementations details.
[1] https://jwt.io/