Class AssertionIDCache
Provides a cache for recording previously used SAMLAssertion
identifiers.
The cache may be used when enforcing single use of SAML assertions.
Inheritance
Inherited Members
Namespace: ComponentSpace.SAML2.Assertions
Assembly: ComponentSpace.Saml2.dll
Syntax
public static class AssertionIDCache
Remarks
The cache is implemented using the System.Web.Caching.Cache
.
Use of this cache is entirely optional.
Refer to the System.Web.Caching.Cache
documentation for usage restrictions.
Properties
Expiration
Gets or sets the expiration time span for cached assertion identifier entries.
Declaration
public static TimeSpan Expiration { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan | The expiration time span for cached assertion identifier entries. |
Methods
Add(SAMLAssertion)
Adds an assertion identifier to the cache. The assertion identifier cannot already exist in the cache.
Declaration
public static bool Add(SAMLAssertion samlAssertion)
Parameters
Type | Name | Description |
---|---|---|
SAMLAssertion | samlAssertion | The SAML assertion whose identifier is to be cached. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
If the SAML assertion includes a Conditions element with a NotOnOrAfter time then that value is used as the expiration time for the cache entry. Otherwise the default expiration time is used.
Add(String)
Adds an assertion identifier to the cache. The assertion identifier cannot already exist in the cache.
Declaration
public static bool Add(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The SAML assertion identifier. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Contains(String)
Indicates whether the assertion identifier is contained in the cache.
Declaration
public static bool Contains(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The SAML assertion identifier. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remove(String)
Removes an assertion identifier from the cache.
Declaration
public static void Remove(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The SAML assertion identifier. |