85276: Store and retrieve the Authentication method in the JWT

This commit is contained in:
Yana De Pauw
2021-12-01 15:33:13 +01:00
parent dcfa74a2c3
commit 16e704a285
14 changed files with 200 additions and 4 deletions

View File

@@ -193,4 +193,17 @@ public class AuthenticationServiceImpl implements AuthenticationService {
public Iterator<AuthenticationMethod> authenticationMethodIterator() {
return getAuthenticationMethodStack().iterator();
}
public String getAuthenticationMethod(final Context context, final HttpServletRequest request) {
final Iterator<AuthenticationMethod> authenticationMethodIterator = authenticationMethodIterator();
while (authenticationMethodIterator.hasNext()) {
final AuthenticationMethod authenticationMethod = authenticationMethodIterator.next();
if (authenticationMethod.isUsed(context, request)) {
return authenticationMethod.getName();
}
}
return null;
}
}