shibboleth-3.5.0

Public Member Functions | List of all members
shibsp::Session Class Referenceabstract

Encapsulates access to a user's security session. More...

`#include <shibsp/SessionCache.h>`

Inheritance diagram for shibsp::Session:

## Public Member Functions
virtual const char * | getID () const =0
| Returns the session key. More...
virtual const char * | getApplicationID () const =0
| Returns the session's application ID. More...
virtual time_t | getExpiration () const =0
| Returns the session expiration. More...
virtual time_t | getLastAccess () const =0
| Returns the last access time of the session. More...
virtual const char * | getClientAddress () const =0
| Returns the address of the client associated with the session. More...
virtual const char * | getEntityID () const =0
| Returns the entityID of the IdP that initiated the session. More...
virtual const char * | getProtocol () const =0
| Returns the protocol family used to initiate the session. More...
virtual const char * | getAuthnInstant () const =0
| Returns the UTC timestamp on the authentication event at the IdP. More...
virtual const opensaml::saml2::NameID * | getNameID () const =0
| Returns the NameID associated with a session. More...
virtual const char * | getSessionIndex () const =0
| Returns the SessionIndex provided with the session. More...
virtual const char * | getAuthnContextClassRef () const =0
| Returns a URI containing an AuthnContextClassRef provided with the session. More...
virtual const char * | getAuthnContextDeclRef () const =0
| Returns a URI containing an AuthnContextDeclRef provided with the session. More...
virtual const std::vector< Attribute * > & | getAttributes () const =0
| Returns the resolved attributes associated with the session. More...
virtual const std::multimap< std::string, const Attribute * > & | getIndexedAttributes () const =0
| Returns the resolved attributes associated with the session, indexed by ID. More...
virtual const std::vector< const char * > & | getAssertionIDs () const =0
| Returns the identifiers of the assertion(s) cached by the session. More...
virtual void | addAttributes (const std::vector< Attribute * > &attributes)=0
| Adds additional attributes to the session. More...
virtual const opensaml::Assertion * | getAssertion (const char *id) const =0
| Returns an assertion cached by the session. More...
virtual void | addAssertion (opensaml::Assertion *assertion)=0
| Stores an assertion in the session. More...

## Detailed Description

Encapsulates access to a user's security session.

The SessionCache does not itself require locking to manage concurrency, but access to each Session is generally exclusive or at least controlled, and the caller must unlock a Session to dispose of it.

## Member Function Documentation

## ◆ addAssertion()

virtual void shibsp::Session::addAssertion | ( | opensaml::Assertion * | assertion | ) |
| pure virtual

Stores an assertion in the session.

Parameters

  assertion | pointer to an assertion to cache (will be freed by cache)

Implemented in shibsp::StoredSession.

## ◆ addAttributes()

virtual void shibsp::Session::addAttributes | ( | const std::vector< Attribute * > & | attributes | ) |
| pure virtual

Adds additional attributes to the session.

Parameters

  attributes | reference to an array of Attributes to cache (will be freed by cache)

Implemented in shibsp::StoredSession.

## ◆ getApplicationID()

virtual const char * shibsp::Session::getApplicationID | ( |  | ) | const
| pure virtual

Returns the session's application ID.

Returns
  unique ID of application bound to session

Implemented in shibsp::StoredSession.

## ◆ getAssertion()

virtual const opensaml::Assertion * shibsp::Session::getAssertion | ( | const char * | id | ) | const
| pure virtual

Returns an assertion cached by the session.

Parameters

  id | identifier of the assertion to retrieve

Returns
  pointer to assertion, or nullptr

Implemented in shibsp::StoredSession.

## ◆ getAssertionIDs()

virtual const std::vector< const char * > & shibsp::Session::getAssertionIDs | ( |  | ) | const
| pure virtual

Returns the identifiers of the assertion(s) cached by the session.

The SSO assertion is guaranteed to be first in the set.

Returns
  an immutable array of AssertionID values

Implemented in shibsp::StoredSession.

## ◆ getAttributes()

virtual const std::vector< Attribute * > & shibsp::Session::getAttributes | ( |  | ) | const
| pure virtual

Returns the resolved attributes associated with the session.

Returns
  an immutable array of attributes

Implemented in shibsp::StoredSession.

## ◆ getAuthnContextClassRef()

virtual const char * shibsp::Session::getAuthnContextClassRef | ( |  | ) | const
| pure virtual

Returns a URI containing an AuthnContextClassRef provided with the session.

SAML 1.x AuthenticationMethods will be returned as class references.

Returns
  a URI identifying the authentication context class

Implemented in shibsp::StoredSession.

## ◆ getAuthnContextDeclRef()

virtual const char * shibsp::Session::getAuthnContextDeclRef | ( |  | ) | const
| pure virtual

Returns a URI containing an AuthnContextDeclRef provided with the session.

Returns
  a URI identifying the authentication context declaration

Implemented in shibsp::StoredSession.

## ◆ getAuthnInstant()

virtual const char * shibsp::Session::getAuthnInstant | ( |  | ) | const
| pure virtual

Returns the UTC timestamp on the authentication event at the IdP.

Returns
  the UTC authentication timestamp

Implemented in shibsp::StoredSession.

## ◆ getClientAddress()

virtual const char * shibsp::Session::getClientAddress | ( |  | ) | const
| pure virtual

Returns the address of the client associated with the session.

Returns
  the client's network address

Implemented in shibsp::StoredSession.

## ◆ getEntityID()

virtual const char * shibsp::Session::getEntityID | ( |  | ) | const
| pure virtual

Returns the entityID of the IdP that initiated the session.

Returns
  the IdP's entityID

Implemented in shibsp::StoredSession.

## ◆ getExpiration()

virtual time_t shibsp::Session::getExpiration | ( |  | ) | const
| pure virtual

Returns the session expiration.

Returns
  the session's expiration time or 0 for none

Implemented in shibsp::StoredSession.

## ◆ getID()

virtual const char * shibsp::Session::getID | ( |  | ) | const
| pure virtual

Returns the session key.

Returns
  unique ID of session

Implemented in shibsp::StoredSession.

## ◆ getIndexedAttributes()

virtual const std::multimap< std::string, const Attribute * > & shibsp::Session::getIndexedAttributes | ( |  | ) | const
| pure virtual

Returns the resolved attributes associated with the session, indexed by ID.

Returns
  an immutable map of attributes keyed by attribute ID

Implemented in shibsp::StoredSession.

## ◆ getLastAccess()

virtual time_t shibsp::Session::getLastAccess | ( |  | ) | const
| pure virtual

Returns the last access time of the session.

Returns
  the session's last access time

Implemented in shibsp::StoredSession.

## ◆ getNameID()

virtual const opensaml::saml2::NameID * shibsp::Session::getNameID | ( |  | ) | const
| pure virtual

Returns the NameID associated with a session.

SAML 1.x identifiers will be promoted to the 2.0 type.

Returns
  a SAML 2.0 NameID associated with the session, if any

Implemented in shibsp::StoredSession.

## ◆ getProtocol()

virtual const char * shibsp::Session::getProtocol | ( |  | ) | const
| pure virtual

Returns the protocol family used to initiate the session.

Returns
  the protocol constant that represents the general SSO protocol used

Implemented in shibsp::StoredSession.

## ◆ getSessionIndex()

virtual const char * shibsp::Session::getSessionIndex | ( |  | ) | const
| pure virtual

Returns the SessionIndex provided with the session.

Returns
  the SessionIndex from the original SSO assertion, if any

Implemented in shibsp::StoredSession.

The documentation for this class was generated from the following file:

- shibsp/SessionCache.h