Package org.keycloak.authentication
Class AuthenticatorUtil
java.lang.Object
org.keycloak.authentication.AuthenticatorUtil
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAuthCallbacksFactoryIds
(AuthenticationSessionModel authSession) Get set of Authentication factories IDs defined in authentication session as CALLBACKS_FACTORY_IDS_NOTEstatic Stream<CredentialProvider>
getCredentialProviders
(KeycloakSession session) static List<AuthenticationExecutionModel>
getExecutionsByType
(RealmModel realm, String flowId, String providerId) static AuthenticationFlowModel
getTopParentFlow
(RealmModel realm, AuthenticationExecutionModel executionModel) Useful if we need to find top-level flow from executionModelstatic boolean
isForcedReauthentication
(AuthenticationSessionModel authSession) static boolean
isForkedFlow
(AuthenticationSessionModel authSession) static boolean
isPasswordValidated
(AuthenticationSessionModel authSession) static boolean
isSSOAuthentication
(AuthenticationSessionModel authSession) static void
logoutOtherSessions
(DefaultActionToken token, ActionTokenContext<? extends DefaultActionToken> context) Logouts all sessions that are different to the current authentication session managed in the action token context.static void
logoutOtherSessions
(RequiredActionContext context) Logouts all sessions that are different to the current authentication session managed in the action context.static void
setAuthCallbacksFactoryIds
(AuthenticationSessionModel authSession, String authFactoryId) Set authentication session note for callbacks defined for {@link AuthenticationFlowCallbackFactory) factories
-
Field Details
-
CALLBACKS_FACTORY_IDS_NOTE
-
-
Constructor Details
-
AuthenticatorUtil
public AuthenticatorUtil()
-
-
Method Details
-
isSSOAuthentication
-
isForcedReauthentication
-
isPasswordValidated
-
isForkedFlow
-
setAuthCallbacksFactoryIds
public static void setAuthCallbacksFactoryIds(AuthenticationSessionModel authSession, String authFactoryId) Set authentication session note for callbacks defined for {@link AuthenticationFlowCallbackFactory) factories- Parameters:
authSession
- authentication sessionauthFactoryId
- authentication factory ID which should be added to the authentication session note
-
getAuthCallbacksFactoryIds
Get set of Authentication factories IDs defined in authentication session as CALLBACKS_FACTORY_IDS_NOTE- Parameters:
authSession
- authentication session- Returns:
- set of factories IDs
-
getExecutionsByType
public static List<AuthenticationExecutionModel> getExecutionsByType(RealmModel realm, String flowId, String providerId) - Parameters:
realm
-flowId
-providerId
-- Returns:
- all executions of given "provider_id" type. This is deep (recursive) obtain of executions of the particular flow
-
getTopParentFlow
public static AuthenticationFlowModel getTopParentFlow(RealmModel realm, AuthenticationExecutionModel executionModel) Useful if we need to find top-level flow from executionModel- Parameters:
realm
-executionModel
-- Returns:
- Top parent flow corresponding to given executionModel.
-
logoutOtherSessions
Logouts all sessions that are different to the current authentication session managed in the action context.- Parameters:
context
- The required action context
-
logoutOtherSessions
public static void logoutOtherSessions(DefaultActionToken token, ActionTokenContext<? extends DefaultActionToken> context) Logouts all sessions that are different to the current authentication session managed in the action token context.- Parameters:
token
- The action tokencontext
- The required action token context
-
getCredentialProviders
- Parameters:
session
-- Returns:
- all credential providers available
-