Interface AutoLoginManager
public interface AutoLoginManager
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classContains the information to present on the auto-login confirmation UI. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddActionToRepresentation(Actions actions, RepresentationModel model) Adds a form action for auto-login to an HAAPI representation being built, if auto-login is enabled.static voidaddToResponse(Response response, AutoLoginManager.ConfirmData data) Adds the confirmation view data to response view modelvoidenableAutoLoginNonce(String sessionKey) Enables an auto-login flow.Checks if the current session has an enabled and valid auto-login nonce.Prepares an auto-login flow.
-
Field Details
-
TEMPLATE_KEY_TOKEN
- See Also:
-
TEMPLATE_KEY_USER_NAME
- See Also:
-
TEMPLATE_KEY_HAS_AUTO_LOGIN
- See Also:
-
FORM_NAME_TOKEN
- See Also:
-
PATH_CONFIRM_CONTINUE
- See Also:
-
-
Method Details
-
prepareAutoLoginNonce
Prepares an auto-login flow. It is typically called by a registration or activation handler.- Parameters:
attrs- the account attributes to use on login.- Returns:
- If successful, a pair with the nonce session key and the user name.
-
enableAutoLoginNonce
Enables an auto-login flow. Typically called after an user confirmation. Before this method is called, the auto-login method is not usable.- Parameters:
sessionKey- the session key where the auto-login nonce is to be found.
-
getAutoLoginFromCurrentSession
Optional<AuthenticationResult> getAutoLoginFromCurrentSession()Checks if the current session has an enabled and valid auto-login nonce. If so, returns the authentication information associated to it.- Returns:
- An optional authentication result, which can be used as the return of an authentication handler.
-
addToResponse
Adds the confirmation view data to response view model- Parameters:
response- the HTTP respose where the view information is assigned.data- the confirmation data.
-
addActionToRepresentation
Adds a form action for auto-login to an HAAPI representation being built, if auto-login is enabled.Uses the model data added by
addToResponse(Response, ConfirmData). The form action that is added to the representations POSTs to thePATH_CONFIRM_CONTINUEpath relative to the authenticator's anonymous endpoint.- Parameters:
actions- The builder allowing the addition of actions to the representationmodel- The response model
-