Class AuthenticationResult

java.lang.Object
org.nuclos.api.authentication.AuthenticationResult

public class AuthenticationResult extends Object
This class is passed to Nuclos as the result of a rule-based authentication.
See Also:
  • Field Details

  • Constructor Details

    • AuthenticationResult

      protected AuthenticationResult()
  • Method Details

    • getId

      public long getId()
      Only a internal id for equals and hashCode.
      Returns:
      the internal id of this result.
    • getUsername

      public String getUsername()
      Either username or user id must be specified.
      Returns:
      the username determined during authentication.
    • getUserId

      public UID getUserId()
      Either username or user id must be specified.
      Returns:
      the user id determined during authentication.
    • getMandatorId

      public UID getMandatorId()
      Returns:
      the mandator id determined during authentication.
    • getLocale

      public NuclosLocale getLocale()
      Returns:
      the locale determined during authentication.
    • getDataLanguage

      public NuclosLocale getDataLanguage()
      Returns:
      the data language determined during authentication.
    • getServerUri

      public URI getServerUri()
      Clients can reach the application server via this base URI. If not specified (null), the default settings are used. Maybe a reverse proxy exists between server and client and requires an adjustment. This is used to create referencing links between data.
      Returns:
      the server uri determined during authentication.
    • isLoginRequired

      public boolean isLoginRequired()
      Returns:
      true if Nuclos should login the user. false drops the session after response. (Determined during authentication)
    • getLifetime

      public long getLifetime()
      The default lifetime is AuthenticationResult.UNSET, which means that the system is handling the session lifetime only and a refresh is never called.
      Returns:
      the lifetime
      See Also:
    • getLifetimeUnit

      public TimeUnit getLifetimeUnit()
      Returns:
      the unit in which lifetime is expressed in
    • setLifetime

      public void setLifetime(long lifetime, TimeUnit unit)
      The default lifetime is AuthenticationResult.UNSET, which means that the system is handling the session lifetime only and a refresh is never called.
      Parameters:
      lifetime -
      unit - the unit that lifetime is expressed in
      See Also:
    • setAttribute

      public void setAttribute(String attribute, String value)
      Store important information during authentication, and access them later during refresh.
      Parameters:
      attribute -
      value -
    • getAttribute

      public String getAttribute(String attribute)
      Parameters:
      attribute -
      Returns:
      value (for the attribute)
    • builder

      public static AuthenticationResult.Builder builder()
      Constructs a new builder instance for an authentication result with default settings.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object