Class OpenIdAuthenticationHandler
- All Implemented Interfaces:
AuthenticationHandler
-
Field Summary
FieldsFields inherited from interface ch.tocco.nice2.security.spi.auth.AuthenticationHandler
ANONYMOUS_HANDLER_ORDER, API_KEY_PK_ATTRIBUTE, PRINCIPAL_PK_ATTRIBUTE, SESSION_HASH_HANDLER_ORDER, SESSION_ID_ATTRIBUTE -
Constructor Summary
ConstructorsConstructorDescriptionOpenIdAuthenticationHandler(Context context, EntityDefaultValueService entityDefaultValueService, QueryBuilderFactory queryBuilderFactory, SecurityManager securityManager, ScriptListenerService scriptListenerService, OpenIdHelperService openIdHelperService) -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(Challenge challenge, Credentials credentials) Authenticates the given challenge by voting for or against it.getName()Return a name of this handler, used for logging.voidpostAuthenticate(Challenge challenge) After authentication has been successful for all registered AuthenticationHandlers, the post-authentication step is invoked to add more authorization information to the principal which is sure to be not null and authenticated when this method is invoked.voidsetSupportLoginsEnabled(boolean supportLoginsEnabled) booleanupdateCredentials(Credentials oldCredentials, Credentials newCredentials) Updates the credentials for this handler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.tocco.nice2.security.spi.auth.AuthenticationHandler
postEventListeners
-
Field Details
-
ORDER
public static final int ORDER- See Also:
-
-
Constructor Details
-
OpenIdAuthenticationHandler
public OpenIdAuthenticationHandler(Context context, EntityDefaultValueService entityDefaultValueService, QueryBuilderFactory queryBuilderFactory, SecurityManager securityManager, ScriptListenerService scriptListenerService, OpenIdHelperService openIdHelperService)
-
-
Method Details
-
getName
Description copied from interface:AuthenticationHandlerReturn a name of this handler, used for logging.- Specified by:
getNamein interfaceAuthenticationHandler
-
authenticate
Description copied from interface:AuthenticationHandlerAuthenticates the given challenge by voting for or against it.
If the supplied credentials are unknown to this handler, it may not vote at all, indicating no meaningful knowledge about the challenge.
- Specified by:
authenticatein interfaceAuthenticationHandler- Parameters:
challenge- the authentication challengecredentials- the credentials supplied by client in case of non-recoverable error. An exception will immediately stop authentication process to failed state.
-
postAuthenticate
Description copied from interface:AuthenticationHandlerAfter authentication has been successful for all registered AuthenticationHandlers, the post-authentication step is invoked to add more authorization information to the principal which is sure to be not null and authenticated when this method is invoked.
This handler may also decide in this step to give a new vote for this challenge which overrides the previously given vote.
If this throws any exception, authentication process is immediately stopped to failed state.
- Specified by:
postAuthenticatein interfaceAuthenticationHandler- Parameters:
challenge- the challenge to authenticate
-
updateCredentials
Description copied from interface:AuthenticationHandlerUpdates the credentials for this handler.If this handler is not supporting this, return
.falseIn case of an exception, the whole process is stopped immediately.
- Specified by:
updateCredentialsin interfaceAuthenticationHandler- Parameters:
oldCredentials- the old credentials are used to get the principalnewCredentials- the new credentials to set. authentication handlers should only support their sepcific type of credentials- Returns:
- true if credentials were updated successfully, false if skipped
-
setSupportLoginsEnabled
@Value("${nice2.userbase.supportLoginsEnabled}") public void setSupportLoginsEnabled(boolean supportLoginsEnabled)
-