Class IdentityServiceAuthenticationComponent
- java.lang.Object
-
- org.alfresco.repo.security.authentication.AbstractAuthenticationComponent
-
- org.alfresco.repo.security.authentication.identityservice.IdentityServiceAuthenticationComponent
-
- All Implemented Interfaces:
ActivateableBean,AuthenticationComponent,AuthenticationContext
public class IdentityServiceAuthenticationComponent extends AbstractAuthenticationComponent implements ActivateableBean
Authenticates a user against Keycloak. Keycloak'sAuthzClientis used to retrieve an access token for the provided user credentials, user is set as the current user if the user's access token can be obtained.
The AuthzClient can be null in which case this authenticator will just fall through to the next one in the chain.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.repo.security.authentication.AuthenticationComponent
AuthenticationComponent.UserNameValidationMode
-
-
Constructor Summary
Constructors Constructor Description IdentityServiceAuthenticationComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthenticateImpl(java.lang.String userName, char[] password)Default unsupported authentication implementation - as of 2.1 this is the best way to implement your own authentication component as it will support guest login - prior to this direct over ride for authenticate(String , char[]) was used.protected booleanimplementationAllowsGuestLogin()booleanisActive()Determines whether this bean is active.voidsetActive(boolean active)voidsetAllowGuestLogin(boolean allowGuestLogin)voidsetAuthenticatorAuthzClient(org.keycloak.authorization.client.AuthzClient authenticatorAuthzClient)-
Methods inherited from class org.alfresco.repo.security.authentication.AbstractAuthenticationComponent
authenticate, clearCurrentSecurityContext, getAllowGuestLogin, getCurrentAuthentication, getCurrentUserName, getDefaultAdministratorUserNames, getDefaultGuestUserNames, getGuestUserName, getGuestUserName, getNodeService, getNumberFailedAuthentications, getNumberSuccessfulAuthentications, getPersonService, getSystemUserName, getSystemUserName, getTransactionService, getUserDetails, getUserDomain, guestUserAuthenticationAllowed, isCurrentUserTheSystemUser, isGuestUserName, isSystemUserName, onAuthenticate, onFail, setAllowGuestLogin, setAuthenticationContext, setCurrentAuthentication, setCurrentUser, setCurrentUser, setDefaultAdministratorUserNameList, setDefaultAdministratorUserNames, setDefaultGuestUserNameList, setDefaultGuestUserNames, setGuestUserAsCurrentUser, setNodeService, setPersonService, setSystemUserAsCurrentUser, setSystemUserAsCurrentUser, setTransactionService, setUserDetails, setUserRegistrySynchronizer
-
-
-
-
Method Detail
-
setAuthenticatorAuthzClient
public void setAuthenticatorAuthzClient(org.keycloak.authorization.client.AuthzClient authenticatorAuthzClient)
-
setAllowGuestLogin
public void setAllowGuestLogin(boolean allowGuestLogin)
-
authenticateImpl
public void authenticateImpl(java.lang.String userName, char[] password) throws org.alfresco.repo.security.authentication.AuthenticationExceptionDescription copied from class:AbstractAuthenticationComponentDefault unsupported authentication implementation - as of 2.1 this is the best way to implement your own authentication component as it will support guest login - prior to this direct over ride for authenticate(String , char[]) was used. This will still work.- Overrides:
authenticateImplin classAbstractAuthenticationComponent- Parameters:
userName- Stringpassword- char[]- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
setActive
public void setActive(boolean active)
-
isActive
public boolean isActive()
Description copied from interface:ActivateableBeanDetermines whether this bean is active.- Specified by:
isActivein interfaceActivateableBean- Returns:
trueif this bean is active
-
implementationAllowsGuestLogin
protected boolean implementationAllowsGuestLogin()
- Specified by:
implementationAllowsGuestLoginin classAbstractAuthenticationComponent
-
-