take into account value request parameter in the claims request for acr claim

Closes #39262

Signed-off-by: cgeorgilakis-grnet <cgeorgilakis@admin.grnet.gr>
This commit is contained in:
cgeorgilakis-grnet
2025-05-05 16:54:15 +03:00
committed by Marek Posolda
parent 23eae748b6
commit 0e7ceaff72
2 changed files with 10 additions and 2 deletions
@@ -119,6 +119,8 @@ public class AcrUtils {
if (!essential || acrClaim.isEssential()) {
if (acrClaim.getValues() != null) {
acrValues.addAll(acrClaim.getValues());
} else if (acrClaim.getValue() != null) {
acrValues.add(acrClaim.getValue());
}
}
}
@@ -1088,15 +1088,21 @@ public class LevelOfAssuranceFlowTest extends AbstractChangeImportedUserPassword
}
public static ClaimsRepresentation claims(boolean essential, String... acrValues) {
//in order to test both values and value
//setValue only for essential false and only one value
ClaimsRepresentation.ClaimValue<String> acrClaim = new ClaimsRepresentation.ClaimValue<>();
acrClaim.setEssential(essential);
acrClaim.setValues(Arrays.asList(acrValues));
if (essential || acrValues.length > 1) {
acrClaim.setValues(Arrays.asList(acrValues));
} else {
acrClaim.setValue(acrValues[0]);
}
ClaimsRepresentation claims = new ClaimsRepresentation();
claims.setIdTokenClaims(Collections.singletonMap(IDToken.ACR, acrClaim));
return claims;
}
private void authenticateWithUsernamePassword() {
loginPage.assertCurrent();
loginPage.login("test-user@localhost", getPassword("test-user@localhost"));