Show / Hide Table of Contents

Class CookieSsoSessionStore

The single sign-on session store implemented using a cookie.

Inheritance
System.Object
CookieSsoSessionStore
Implements
ISsoSessionStore
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ComponentSpace.Saml2.Session
Assembly: ComponentSpace.Saml2.dll
Syntax
public class CookieSsoSessionStore : ISsoSessionStore

Constructors

CookieSsoSessionStore(IOptionsMonitor<CookieSsoSessionStoreOptions>, IDataProtectionProvider, IHttpRequest, IHttpResponse, ILoggerFactory)

Initializes a new instance of the CookieSsoSessionStore class.

Declaration
public CookieSsoSessionStore(IOptionsMonitor<CookieSsoSessionStoreOptions> cookieSsoSessionStoreOptions, IDataProtectionProvider dataProtectionProvider, IHttpRequest request, IHttpResponse response, ILoggerFactory loggerFactory)
Parameters
Type Name Description
Microsoft.Extensions.Options.IOptionsMonitor<CookieSsoSessionStoreOptions> cookieSsoSessionStoreOptions

The cookie SSO session store options.

Microsoft.AspNetCore.DataProtection.IDataProtectionProvider dataProtectionProvider

The data protection provider used to secure the cookie value.

IHttpRequest request

The HTTP request.

IHttpResponse response

The HTTP response.

Microsoft.Extensions.Logging.ILoggerFactory loggerFactory

The logger factory.

Properties

SessionID

Gets the unique SSO session identifier.

Declaration
public virtual string SessionID { get; }
Property Value
Type Description
System.String

The unique SSO session identifier.

Methods

AddCookie(String, String, CookieOptions)

Adds the SAML session cookie to the HTTP response.

Declaration
protected virtual void AddCookie(string cookieName, string cookieValue, CookieOptions cookieOptions)
Parameters
Type Name Description
System.String cookieName

The cookie name.

System.String cookieValue

The cookie value.

CookieOptions cookieOptions

The cookie options.

Compress(Byte[])

Compresses the bytes.

Declaration
public static byte[] Compress(byte[] bytesToCompress)
Parameters
Type Name Description
System.Byte[] bytesToCompress

The bytes to compress.

Returns
Type Description
System.Byte[]

The compressed bytes.

DecodeCookieValue<T>(String)

Decodes the cookie value.

Declaration
protected virtual T DecodeCookieValue<T>(string encodedCookieValue)
Parameters
Type Name Description
System.String encodedCookieValue

The encoded cookie value.

Returns
Type Description
T

The cookie value.

Type Parameters
Name Description
T

The cookie value type.

Decompress(Byte[])

Decompresses the bytes.

Declaration
public static byte[] Decompress(byte[] bytesToDecompress)
Parameters
Type Name Description
System.Byte[] bytesToDecompress

The bytes to decompress.

Returns
Type Description
System.Byte[]

The decompressed bytes.

Deserialize<T>(String)

Deserialize the object from a string.

Declaration
public static T Deserialize<T>(string stringToDeserialize)
Parameters
Type Name Description
System.String stringToDeserialize

The object serialized as a string.

Returns
Type Description
T

The object.

Type Parameters
Name Description
T

The object type.

EncodeCookieValue(Object)

Encodes the cookie value.

Declaration
protected virtual string EncodeCookieValue(object cookieValue)
Parameters
Type Name Description
System.Object cookieValue

The cookie value.

Returns
Type Description
System.String

The encoded cookie value.

LoadAsync<T>()

Loads the SSO session object.

Declaration
public virtual Task<T> LoadAsync<T>()
Returns
Type Description
System.Threading.Tasks.Task<T>

A task that represents the operation and returns the SSO session object or null if none.

Type Parameters
Name Description
T

RefreshAsync<T>()

Refreshes the SSO session object so the sliding expiration is reset.

Declaration
public virtual Task RefreshAsync<T>()
Returns
Type Description
System.Threading.Tasks.Task

A task that represents the operation.

Type Parameters
Name Description
T

RemoveAsync<T>()

Removes the SSO session object.

Declaration
public virtual Task RemoveAsync<T>()
Returns
Type Description
System.Threading.Tasks.Task

A task that represents the operation.

Type Parameters
Name Description
T

SaveAsync(Object)

Saves the SSO session object.

Declaration
public virtual Task SaveAsync(object ssoSession)
Parameters
Type Name Description
System.Object ssoSession

The SSO session object.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the operation.

Serialize(Object)

Serialize the object to a string.

Declaration
public static string Serialize(object objectToSerialize)
Parameters
Type Name Description
System.Object objectToSerialize

The object to serialize.

Returns
Type Description
System.String

The object serialized as a string.

Implements

ISsoSessionStore
In This Article
Back to top Copyright © ComponentSpace Pty Ltd 2017-2022. All rights reserved.