Package org.jdrupes.keycloak.moodleauth
Class MoodleAuthenticator
java.lang.Object
org.jdrupes.keycloak.moodleauth.MoodleAuthenticator
- All Implemented Interfaces:
org.keycloak.authentication.Authenticator,org.keycloak.provider.Provider
public class MoodleAuthenticator
extends Object
implements org.keycloak.authentication.Authenticator
The Class MoodleAuthenticator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaction(org.keycloak.authentication.AuthenticationFlowContext context) Called when the form has been submitted.voidauthenticate(org.keycloak.authentication.AuthenticationFlowContext context) Start the authentication by creating the form.voidclose()Not documented by keycloak.booleanconfiguredFor(org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.models.UserModel user) Is this authenticator configured for this user.booleanUser does not have to been identified, because this is a combined login/auto registration form.voidsetRequiredActions(org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.models.UserModel user) Never called becauseMoodleAuthenticatorFactory.isUserSetupAllowed()returns false.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.authentication.Authenticator
areRequiredActionsEnabled, getRequiredActions
-
Constructor Details
-
MoodleAuthenticator
public MoodleAuthenticator()
-
-
Method Details
-
requiresUser
User does not have to been identified, because this is a combined login/auto registration form.So return false;
- Specified by:
requiresUserin interfaceorg.keycloak.authentication.Authenticator- Returns:
- false
-
configuredFor
public boolean configuredFor(org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.models.UserModel user) Is this authenticator configured for this user.- Specified by:
configuredForin interfaceorg.keycloak.authentication.Authenticator- Parameters:
session- the sessionrealm- the realmuser- the user- Returns:
- true, if successful
-
setRequiredActions
public void setRequiredActions(org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.models.UserModel user) Never called becauseMoodleAuthenticatorFactory.isUserSetupAllowed()returns false.- Specified by:
setRequiredActionsin interfaceorg.keycloak.authentication.Authenticator- Parameters:
session- the sessionrealm- the realmuser- the user
-
close
Not documented by keycloak.Probably supposed to release resources. Does nothing.
- Specified by:
closein interfaceorg.keycloak.provider.Provider
-
authenticate
Start the authentication by creating the form.- Specified by:
authenticatein interfaceorg.keycloak.authentication.Authenticator- Parameters:
context- the context
-
action
Called when the form has been submitted.Checks if the user/password combination is valid by trying to access the Moodle instance. If successful, creates the user if it doesn’t exist yet.
- Specified by:
actionin interfaceorg.keycloak.authentication.Authenticator- Parameters:
context- the context
-