Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
Edit Service Provider > Claim Configuration > Requested Claims > Click Add Claim URI and add few claims (3-5 claims)
Update
Again Edit Service Provider > Claim configuration > Requested Claims > remove few claims (remove 2 claims out of 3)
Without Clicking Update Add another new Claim (now total claims are 2)
Click Update
Now again list down the requested claims and check whether the newly added claim is there but notice that it has not been saved
Findings:
In the update method of the ApplicationBean[1], when updating the claims it takes the claims using request parameters and each claim gets a number appended in the request parameter depending on the number of rows in the UI table. As an example
if there are 2 claims in the UI table those claims will be referred as idpClaim_0 and idpClaim_1 OR spClaim_0 and spClaim_1, check the logic in update method [1]
These row number values are set by using a logic in configure-service-provider.jsp [2] and it seems like the claimMappinRowID variable does not get updated correctly when trying to remove and add claims simultaneously
Environment: Identity Server 5.10.0 / 5.11.0
Steps to reproduce:
Findings:
In the update method of the ApplicationBean[1], when updating the claims it takes the claims using request parameters and each claim gets a number appended in the request parameter depending on the number of rows in the UI table. As an example if there are 2 claims in the UI table those claims will be referred as idpClaim_0 and idpClaim_1 OR spClaim_0 and spClaim_1, check the logic in update method [1]
These row number values are set by using a logic in configure-service-provider.jsp [2] and it seems like the claimMappinRowID variable does not get updated correctly when trying to remove and add claims simultaneously
[1] - https://github.com/wso2/carbon-identity-framework/blob/7482f7e649fbfe93b513bd9e460faea8263a36b0/components/application-mgt/org.wso2.carbon.identity.application.mgt.ui/src/main/java/org/wso2/carbon/identity/application/mgt/ui/ApplicationBean.java#L1316
[2] - https://github.com/wso2/carbon-identity-framework/blob/7482f7e649fbfe93b513bd9e460faea8263a36b0/components/application-mgt/org.wso2.carbon.identity.application.mgt.ui/src/main/resources/web/application/configure-service-provider.jsp#L507