HTTP API Toolkit HTTP API Toolkit
HTTP API Toolkit HTTP API Toolkit
DocFX + Singulink = ♥

Search Results for

    Class HttpSessionContext<TSessionToken, TSessionData>

    Provides methods for handling user session tokens.

    Inheritance
    object
    SessionContext<TSessionToken>
    HttpSessionContext<TSessionToken>
    HttpSessionContext<TSessionToken, TSessionData>
    Implements
    IBindableFromHttpContext<SessionContext<TSessionToken>>
    IBindableFromHttpContext<HttpSessionContext<TSessionToken>>
    Inherited Members
    HttpSessionContext<TSessionToken>.Device
    HttpSessionContext<TSessionToken>.IpAddress
    HttpSessionContext<TSessionToken>.IsRequestOriginAllowed()
    Namespace: Singulink.Net.Http.Api.Service
    Assembly: Singulink.Net.Http.Api.Service.dll
    Syntax
    public sealed class HttpSessionContext<TSessionToken, TSessionData> : HttpSessionContext<TSessionToken>, IBindableFromHttpContext<SessionContext<TSessionToken>>, IBindableFromHttpContext<HttpSessionContext<TSessionToken>> where TSessionToken : class, ISessionToken where TSessionData : class, ISessionData
    Type Parameters
    Name Description
    TSessionToken
    TSessionData

    Properties

    Name Description
    HttpContext

    Gets the HTTP context for the current request.

    Methods

    Name Description
    ClearToken()

    Clears the session cookie for the current request user. Subsequent token retrievals in the current request return null, and any pending deferred token refresh is cancelled.

    GetRequiredTokenAsync(SessionAccessOptions)

    Gets the session token from the current request. If the user is not signed in, throws an UnauthorizedApiException.

    GetTokenAsync(SessionAccessOptions)

    Gets the session token from the current request. If the user is not signed in, returns null.

    SetToken(TSessionToken)

    Sets the session cookie for the current request user to the specified session token. Subsequent token retrievals in the current request return the specified token, and any pending deferred token refresh is cancelled.

    SignInAsync(bool, Func<SignInInfo, Task<TSessionToken>>)

    Signs in a user by creating a new session using the provided function and setting the session cookie to the session token returned by the function.

    SignOutAsync()

    Signs out the current request user by invalidating the session and clearing the session cookie.

    © Singulink. All rights reserved.