Skip to main content

IAuthSessionService Interface

Abblix.Oidc.Server

Abblix.Oidc.Server.Features.UserAuthentication

IAuthSessionService Interface

Manages user authentication, providing mechanisms to sign in, sign out, and maintain user sessions. This interface plays a pivotal role in the security and session management of an application, ensuring that users are authenticated and their sessions are managed securely across different contexts and client applications.

public interface IAuthSessionService

Methods

IAuthSessionService.AuthenticateAsync() Method

Authenticates the current user based on the session context, verifying their identity and session validity. This method is crucial for ensuring that requests are made by an authenticated user and for retrieving the user's session information.

System.Threading.Tasks.Task<Abblix.Oidc.Server.Features.UserAuthentication.AuthSession?> AuthenticateAsync();

Returns

System.Threading.Tasks.Task<AuthSession>
A task that resolves to an AuthSession representing the authenticated user's session, or null if no valid session exists.

IAuthSessionService.GetAvailableAuthSessions() Method

Retrieves currently active authentication sessions for the user. This method is typically used to display all sessions that a user has, allowing them to manage their sessions.

System.Collections.Generic.IAsyncEnumerable<Abblix.Oidc.Server.Features.UserAuthentication.AuthSession> GetAvailableAuthSessions();

Returns

System.Collections.Generic.IAsyncEnumerable<AuthSession>
An asynchronous stream of AuthSession instances, each representing an active user session.

IAuthSessionService.SignInAsync(AuthSession) Method

Initiates a new user session based on provided user claims, effectively signing in the user. This method is essential for establishing new user sessions following successful authentication.

System.Threading.Tasks.Task SignInAsync(Abblix.Oidc.Server.Features.UserAuthentication.AuthSession authSession);

Parameters

authSession AuthSession

Detailed information about the authentication session to be established.

Returns

System.Threading.Tasks.Task
A task that signifies the completion of the user sign-in process.

IAuthSessionService.SignOutAsync() Method

Terminates the current user session, effectively signing out the user. This method is crucial for maintaining the security of the application by ensuring that user sessions can be properly closed.

System.Threading.Tasks.Task SignOutAsync();

Returns

System.Threading.Tasks.Task
A task that signifies the completion of the user sign-out process.