Class ContextAttributes
- All Implemented Interfaces:
Iterable<Attribute>,AttributeContainer<MapAttributeValue>,AttributeOrAttributeValue<AttributeValue>,AttributeValue
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionAppends the given attribute to a copy of this, returning the result.static ContextAttributesempty()getAcr()Get the ACR-value of the context-attributes, or null if it doesn't exist.Get the authentication session data, including the profile ID and service provider ID as well as session ID.longlonggetScope()getSid()Get optional value of thesidattribute.static ContextAttributesCreates a newContextAttributesobject that contains attributes about a context (i.e., environment), including the authentication time.static ContextAttributesCreates a newContextAttributesobject that contains attributes about a context (i.e., environment), optionally including the authentication timestatic ContextAttributesCreates a newContextAttributesobject that contains attributes about a context (i.e., environment).Add the given attribute if not present, or replace the attribute if it already exists.Methods inherited from class se.curity.identityserver.sdk.attribute.MapAttributeValue
append, delete, equals, get, get, getAll, getAttributesByName, getMandatory, getValue, getValueWithAuthorities, getValueWithMetadata, hashCode, isEmpty, iterator, keys, map, map, map, mapEntries, mapNonRecursive, nullOrOfType, of, removeAttributes, removeNullAttributeValues, retainAttributes, size, stream, toString, withMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface se.curity.identityserver.sdk.attribute.AttributeContainer
contains, contains, getOptionalValue, getOptionalValue, removeAttribute, retainAttributeMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
AUTH_TIME
- See Also:
-
ACR
- See Also:
-
EXPIRES_AT
- See Also:
-
SCOPE
- See Also:
-
SID
- See Also:
-
CLIENT_ASSURANCE_LEVEL
- See Also:
-
CLIENT_ASSERTION_POLICY
- See Also:
-
-
Method Details
-
empty
-
of
Creates a newContextAttributesobject that contains attributes about a context (i.e., environment), including the authentication time.If
attributesdoes not contain the authentication time (i.e., anAttributewith a name ofAUTH_TIME), it will be added as the current time (in seconds since Epoch). If the authentication time is contained inattributes, that value will not be modified.- Parameters:
attributes- the attributes that represent the context- Returns:
- a new
ContextAttributesobject which will always contain an authentication time - See Also:
-
of
public static ContextAttributes of(Iterable<Attribute> attributes, boolean addAuthTimeIfNotProvided) Creates a newContextAttributesobject that contains attributes about a context (i.e., environment), optionally including the authentication timeIf
attributesdoes not contain the authentication time (i.e., anAttributewith a name ofAUTH_TIME), it will only be added ifaddAuthTimeIfNotProvidedistrue; otherwise, it will not be added to the resultingContextAttributes. If it is added, the value will be the number of seconds since Epoch. If the authentication time is contained inattributes, that value will not be modified regardless of the value ofaddAuthTimeIfNotProvided.- Parameters:
attributes- the attributes that represent the context which may or may not contain the authentication timeaddAuthTimeIfNotProvided- whether or not the authentication time should be added ifattributesdoes not include it- Returns:
- the new
ContextAttributesobject - See Also:
-
of
Creates a newContextAttributesobject that contains attributes about a context (i.e., environment).If
attributesdoes not contain the authentication time (i.e., an entry with a name ofAUTH_TIME), it will be added as the current time (in seconds since Epoch). If the authentication time is contained inmap, that value will not be modified.- Parameters:
map- the map of entries that will be represented with attributes in the new context- Returns:
- a new
ContextAttributesobject
-
append
Description copied from interface:AttributeContainerAppends the given attribute to a copy of this, returning the result.- Specified by:
appendin interfaceAttributeContainer<MapAttributeValue>- Overrides:
appendin classMapAttributeValue- Parameters:
attributes- to append- Returns:
- copy of this with the provided attribute appended to it
-
with
Description copied from interface:AttributeContainerAdd the given attribute if not present, or replace the attribute if it already exists. Note that two attributes with the same name and different authorities are considered distinct.- Specified by:
within interfaceAttributeContainer<MapAttributeValue>- Overrides:
within classMapAttributeValue- Parameters:
attribute- attribute to add or to override- Returns:
- a copy of this which contains the given Attribute
-
getAuthTime
public long getAuthTime() -
getAcr
Get the ACR-value of the context-attributes, or null if it doesn't exist.Type safe getter, as a non-String ACR-value is ignored.
- Returns:
- ACR of the ContextAttributes, or null if it doesn't exist
-
getExpiresAt
public long getExpiresAt() -
getScope
-
getScopes
-
getSid
Get optional value of thesidattribute.- Returns:
- sid value, or null if ContextAttributes did not contain a `sid` attribute
- Since:
- 5.1.0
-
getAuthenticationSessionAttribute
Get the authentication session data, including the profile ID and service provider ID as well as session ID.- Returns:
- the authentication data if any; null otherwise.
- Since:
- 5.1.0
-