mirror of
https://github.com/keycloak/keycloak.git
synced 2026-05-12 19:09:38 -05:00
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:
committed by
Marek Posolda
parent
23eae748b6
commit
0e7ceaff72
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-2
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user