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 Details

  • 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

      public String 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

      public void authenticate() throws LoginException
      Throws:
      LoginException
    • acceptExternallyAuthenticatedPrincipal

      public void acceptExternallyAuthenticatedPrincipal(Principal principal)
    • getPrincipal

      public Principal getPrincipal()
    • getSubject

      public Subject getSubject()
    • getCredentials

      public Credentials getCredentials()
    • unAuthenticate

      public void unAuthenticate()
      Resets all security state and credentials
    • logout

      public void logout()
    • getWorkingParameters

      public HashMap<String,Object> getWorkingParameters()
    • isSetWorkingParameter

      public boolean isSetWorkingParameter(String name)
    • getWorkingParameter

      public Object getWorkingParameter(String name)
    • setWorkingParameter

      public void setWorkingParameter(String name, Object value)