Package org.nuclos.api.authentication
Class AuthenticationResult
java.lang.Object
org.nuclos.api.authentication.AuthenticationResult
This class is passed to Nuclos as the result of a rule-based authentication.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationResult.Builderbuilder()Constructs a new builder instance for an authentication result with default settings.booleangetAttribute(String attribute) longgetId()Only a internal id for equals and hashCode.longThe default lifetime isAuthenticationResult.UNSET, which means that the system is handling the session lifetime only and a refresh is never called.Clients can reach the application server via this base URI.Either username or user id must be specified.Either username or user id must be specified.inthashCode()booleanbooleanvoidsetAttribute(String attribute, String value) Store important information during authentication, and access them later during refresh.voidsetLifetime(long lifetime, TimeUnit unit) The default lifetime isAuthenticationResult.UNSET, which means that the system is handling the session lifetime only and a refresh is never called.toString()
-
Field Details
-
UNSET
public static final long UNSET- See Also:
-
-
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
Either username or user id must be specified.- Returns:
- the username determined during authentication.
-
getUserId
Either username or user id must be specified.- Returns:
- the user id determined during authentication.
-
getMandatorId
- Returns:
- the mandator id determined during authentication.
-
getLocale
- Returns:
- the locale determined during authentication.
-
getDataLanguage
- Returns:
- the data language determined during authentication.
-
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:
trueif Nuclos should login the user.falsedrops the session after response. (Determined during authentication)
-
isAuthSourceTrusted
public boolean isAuthSourceTrusted()- Returns:
trueif Nuclos should trust this login source and therefore does not load user details from the database. This only has an effect ifisLoginRequiredyields false.falseDefault value. Load user details from the database. (Determined during authentication)
-
getLifetime
public long getLifetime()The default lifetime isAuthenticationResult.UNSET, which means that the system is handling the session lifetime only and a refresh is never called.- Returns:
- the lifetime
- See Also:
-
getLifetimeUnit
- Returns:
- the unit in which lifetime is expressed in
-
setLifetime
The default lifetime isAuthenticationResult.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
Store important information during authentication, and access them later during refresh.- Parameters:
attribute-value-
-
getAttribute
- Parameters:
attribute-- Returns:
- value (for the attribute)
-
builder
Constructs a new builder instance for an authentication result with default settings. -
equals
-
hashCode
public int hashCode() -
toString
-