Package net.shibboleth.idp.session
Interface IdPSession
- All Superinterfaces:
Component,IdentifiedComponent
- All Known Implementing Classes:
AbstractIdPSession,StorageBackedIdPSession
An identity provider session belonging to a particular subject and client device.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName ofMDCattribute that holds the current session ID:idp.session.id. -
Method Summary
Modifier and TypeMethodDescriptionAdd a newAuthenticationResultto this IdP session, replacing any existing result of the same flow ID.addSPSession(SPSession spSession) Add a new SP session to this IdP session, replacing any existing session for the same service.booleancheckAddress(String address) Test the session's validity based on the supplied client address, possibly binding it to the session if appropriate.booleanTest the session's validity based on inactivity, while updating the last activity time.getAuthenticationResult(String flowId) Get an associatedAuthenticationResultgiven its flow ID.Get the unmodifiable set ofAuthenticationResults associated with this session.Get the time when this session was created.Get the last activity instant for the session.Get the canonical principal name for the session.getSPSession(String serviceId) Get the SPSession for a given service.Gets the unmodifiable collection of service sessions associated with this session.booleanDisassociate anAuthenticationResultfrom this IdP session.booleanremoveSPSession(SPSession spSession) Disassociate the given SP session from this IdP session.voidUpdate the recorded activity timestamp for anAuthenticationResultassociated with this session.Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
MDC_ATTRIBUTE
Name ofMDCattribute that holds the current session ID:idp.session.id.- See Also:
-
-
Method Details
-
getPrincipalName
Get the canonical principal name for the session.- Returns:
- the principal name
-
getCreationInstant
Get the time when this session was created.- Returns:
- time this session was created
-
getLastActivityInstant
Get the last activity instant for the session.- Returns:
- last activity instant for the session
-
checkAddress
Test the session's validity based on the supplied client address, possibly binding it to the session if appropriate.- Parameters:
address- client address for validation- Returns:
- true iff the session is valid for the specified client address
- Throws:
SessionException- if an error occurs binding the address to the session
-
checkTimeout
Test the session's validity based on inactivity, while updating the last activity time.- Returns:
- true iff the session is still valid
- Throws:
SessionException- if an error occurs updating the activity time
-
getAuthenticationResults
Get the unmodifiable set ofAuthenticationResults associated with this session.- Returns:
- unmodifiable set of results
-
getAuthenticationResult
Get an associatedAuthenticationResultgiven its flow ID.- Parameters:
flowId- the ID of theAuthenticationResult- Returns:
- the authentication result, or null
-
addAuthenticationResult
@Nullable AuthenticationResult addAuthenticationResult(@Nonnull AuthenticationResult result) throws SessionException Add a newAuthenticationResultto this IdP session, replacing any existing result of the same flow ID.- Parameters:
result- the result to add- Returns:
- a previously existing result replaced by the new one, if any
- Throws:
SessionException- if an error occurs updating the session
-
updateAuthenticationResultActivity
void updateAuthenticationResultActivity(@Nonnull AuthenticationResult result) throws SessionException Update the recorded activity timestamp for anAuthenticationResultassociated with this session.- Parameters:
result- the result to update- Throws:
SessionException- if an error occurs updating the session
-
removeAuthenticationResult
Disassociate anAuthenticationResultfrom this IdP session.- Parameters:
result- the result to disassociate- Returns:
- true iff the given result had been associated with this IdP session and now is not
- Throws:
SessionException- if an error occurs accessing the session
-
getSPSessions
Gets the unmodifiable collection of service sessions associated with this session.- Returns:
- unmodifiable collection of service sessions associated with this session
-
getSPSession
Get the SPSession for a given service.- Parameters:
serviceId- ID of the service- Returns:
- the session service or null if no session exists for that service, may be null
-
addSPSession
Add a new SP session to this IdP session, replacing any existing session for the same service.- Parameters:
spSession- the SP session- Returns:
- a previously existing SPSession replaced by the new one, if any
- Throws:
SessionException- if an error occurs accessing the session
-
removeSPSession
Disassociate the given SP session from this IdP session.- Parameters:
spSession- the SP session- Returns:
- true iff the given SP session had been associated with this IdP session and now is not
- Throws:
SessionException- if an error occurs accessing the SP session
-