When logging in to the Playground2 Sample with the Identity Server(as in the previous blog post - Getting Started with OAuth 2.0 using WSO2 Identity Server 5.3.0 and Playground2 Sample), it prompted for few claim values again although those claims were already set in the logged in user’s profile.
This blog post provides the steps to be taken in order to avoid this being prompted each and every time a user logs in.
This happens since these 2 local claims (http://wso2.org/claims/organization and http://wso2.org/claims/givenname) are not mapped in OIDC claim dialect as mentioned in https://docs.wso2.com/display/IS530/Adding+Claim+Mapping.
In order to map, following steps should be followed.
Select 'List' under 'Claims' in WSO2 Identity Server Management Console Main Tab.
From there, select 'List' under 'Claims' in WSO2 Identity Server Management Console Main Tab.
Next, select the OIDC claim dialect to be mapped from the list. Since I want to map the 'given_name' claim, I will select the 'Edit' of that claim as below.
From the below given interface, select 'http://wso2.org/claims/givenname' from the 'Mapped Local Claim' dropdown and 'Update'.
In order to add the claim 'Organization', select 'Add' under 'Claims' in WSO2 Identity Server Management Console Main Tab.
Then, next step is to select 'Add External Claim' from the given options.
From here, in the 'Dialect URI' dropdown select the dialect you want to add the claim to. I will select 'http://wso2.org/oidc/claim' since that's the claim we want to add the claim to.
Then provide the claim as 'External Claim URI' and select the local claim as 'Mapped Local Claim' from the drop down.
After following these steps you can successfully log in to the Playground2 without providing Mandatory claims.
As mentioned above, if any user claim you set in the claim configuration of the service provider to be received to the client app, if the same claim is not added in the Open ID Connect Dialect, after authentication Identity Server will request the user to provide those claims. In order to avoid that, always make sure to map all the requested claims in the OIDC dialect with the claims in the Local Claim Dialect.
Comments
Post a Comment