Package io.jans.model.security
Class Identity
java.lang.Object
io.jans.model.security.Identity
- All Implemented Interfaces:
Serializable
@RequestScoped
@Named
@Alternative
@Priority(2010)
public class Identity
extends Object
implements Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptExternallyAuthenticatedPrincipal(Principal principal) voidvoidcreate()getWorkingParameter(String name) booleanSimple check that returns true if the user is logged in, without attempting to authenticatebooleanisSetWorkingParameter(String name) login()Attempts to authenticate the user.voidlogout()voidAttempts a quiet login, suppressing any login exceptions and not creating any faces messages.voidsetWorkingParameter(String name, Object value) booleantryLogin()Will attempt to authenticate quietly if the user's credentials are set and they haven't authenticated already.voidResets all security state and credentials
-
Field Details
-
EVENT_LOGIN_SUCCESSFUL
- See Also:
-
ROLES_GROUP
- See Also:
-
-
Constructor Details
-
Identity
public Identity()
-
-
Method Details
-
create
@PostConstruct public void create() -
isLoggedIn
public boolean isLoggedIn()Simple check that returns true if the user is logged in, without attempting to authenticate- Returns:
- true if the user is logged in
-
tryLogin
public boolean tryLogin()Will attempt to authenticate quietly if the user's credentials are set and they haven't authenticated already. A quiet authentication doesn't throw any exceptions if authentication fails.- Returns:
- true if the user is logged in, false otherwise
-
login
Attempts to authenticate the user.- Returns:
- String returns "loggedIn" if user is authenticated, or null if not.
-
quietLogin
public void quietLogin()Attempts a quiet login, suppressing any login exceptions and not creating any faces messages. This method is intended to be used primarily as an internal API call, however has been made public for convenience. -
authenticate
- Throws:
LoginException
-
acceptExternallyAuthenticatedPrincipal
-
getPrincipal
-
getSubject
-
getCredentials
-
unAuthenticate
public void unAuthenticate()Resets all security state and credentials -
logout
public void logout() -
getWorkingParameters
-
isSetWorkingParameter
-
getWorkingParameter
-
setWorkingParameter
-