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

Search Results for

    Class SignInCodes

    Creates and redeems one-time sign-in codes. A code is bound to a PKCE code challenge, so only the holder of the matching code verifier can exchange it for a session, wherever the code travels (a redirect to an app, a device link or a response that could be intercepted).

    Inheritance
    object
    SignInCodes
    Namespace: Singulink.Net.Http.Api.Service.SignIn
    Assembly: Singulink.Net.Http.Api.Service.dll
    Syntax
    public sealed class SignInCodes
    Remarks

    Every way of signing in can end the same way: the client sends a code challenge when it starts signing in, the step that verifies the user (a passkey, a password, an approved device link) creates a code bound to that challenge with CreateAsync(string, string, string?, CancellationToken) and returns it, and the client exchanges it for a session with its code verifier through an endpoint that calls SignInAsync<TSessionToken>(SessionContext<TSessionToken>, RedeemSignInCodeCommand, Func<RedeemedSignInCode, SignInInfo, Task<TSessionToken>>, CancellationToken).

    Codes are kept in the registered IShortLivedStore.

    Constructors

    Name Description
    SignInCodes(IShortLivedStore, IOptions<SignInCodeOptions>, ILogger<SignInCodes>)

    Initializes a new instance of the SignInCodes class.

    Methods

    Name Description
    CreateAsync(string, string, string?, CancellationToken)

    Creates a one-time sign-in code for a user, bound to the specified PKCE code challenge.

    RedeemAsync(string, string, CancellationToken)

    Redeems a sign-in code and returns the ID of the user it signs in and the app's value it was created with, or null if the code is unknown, expired or already used, or the code verifier does not match the code's challenge.

    SignInAsync<TSessionToken>(SessionContext<TSessionToken>, RedeemSignInCodeCommand, Func<RedeemedSignInCode, SignInInfo, Task<TSessionToken>>, CancellationToken)

    Signs in the user of a one-time sign-in code with the values of a RedeemSignInCodeCommand: checks the request's origin with EnsureSignInOriginAllowed(), redeems the code with RedeemAsync(string, string, CancellationToken) and then signs in with SignInAsync(bool, Func<SignInInfo, Task<TSessionToken>>).

    SignInAsync<TSessionToken>(SessionContext<TSessionToken>, string, string, bool, Func<RedeemedSignInCode, SignInInfo, Task<TSessionToken>>, CancellationToken)

    Signs in the user of a one-time sign-in code: checks the request's origin with EnsureSignInOriginAllowed(), redeems the code with RedeemAsync(string, string, CancellationToken) and then signs in with SignInAsync(bool, Func<SignInInfo, Task<TSessionToken>>).

    Extension Methods

    PasskeySignInCodesExtensions.CreateAsync(SignInCodes, RegisteredPasskey, string?, CancellationToken)
    PasskeySignInCodesExtensions.CreateAsync(SignInCodes, VerifiedPasskey, string?, CancellationToken)
    © Singulink. All rights reserved.