parent
2877482e40
commit
3dd97f3f2f
2 changed files with 8 additions and 1 deletions
|
@ -17,8 +17,10 @@
|
|||
|
||||
package org.keycloak.authentication;
|
||||
|
||||
import org.keycloak.models.AuthenticatedClientSessionModel;
|
||||
import org.keycloak.models.Constants;
|
||||
import org.keycloak.sessions.AuthenticationSessionModel;
|
||||
import org.keycloak.sessions.CommonClientSessionModel;
|
||||
|
||||
public class AuthenticatorUtil {
|
||||
|
||||
|
@ -40,4 +42,9 @@ public class AuthenticatorUtil {
|
|||
return AuthenticatorUtil.getRequestedLevelOfAuthentication(authSession)
|
||||
<= AuthenticatorUtil.getCurrentLevelOfAuthentication(authSession);
|
||||
}
|
||||
|
||||
public static int getCurrentLevelOfAuthentication(AuthenticatedClientSessionModel clientSession) {
|
||||
String clientSessionLoaNote = clientSession.getNote(Constants.LEVEL_OF_AUTHENTICATION);
|
||||
return clientSessionLoaNote == null ? Constants.NO_LOA : Integer.parseInt(clientSessionLoaNote);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -854,7 +854,7 @@ public class TokenManager {
|
|||
}
|
||||
|
||||
private String getAcr(AuthenticatedClientSessionModel clientSession) {
|
||||
int loa = Integer.parseInt(clientSession.getNote(Constants.LEVEL_OF_AUTHENTICATION));
|
||||
int loa = AuthenticatorUtil.getCurrentLevelOfAuthentication(clientSession);
|
||||
if (loa < Constants.MINIMUM_LOA) {
|
||||
loa = AuthenticationManager.isSSOAuthentication(clientSession) ? 0 : 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue