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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
action
(org.keycloak.authentication.AuthenticationFlowContext context) Called when the form has been submitted.void
authenticate
(org.keycloak.authentication.AuthenticationFlowContext context) Start the authentication by creating the form.void
close()
Not documented by keycloak.boolean
configuredFor
(org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.models.UserModel user) Is this authenticator configured for this user.boolean
User does not have to been identified, because this is a combined login/auto registration form.void
setRequiredActions
(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, wait
Methods 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:
requiresUser
in 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:
configuredFor
in 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:
setRequiredActions
in 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:
close
in interfaceorg.keycloak.provider.Provider
-
authenticate
Start the authentication by creating the form.- Specified by:
authenticate
in 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:
action
in interfaceorg.keycloak.authentication.Authenticator
- Parameters:
context
- the context
-