You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.8 KiB
2.8 KiB
LINGYUN.Abp.OpenIddict.AspNetCore.Session
Introduction
LINGYUN.Abp.OpenIddict.AspNetCore.Session is a session management extension module for OpenIddict, providing functionality for user session persistence, validation, and revocation.
Features
-
User Session Management
- Automatic session persistence on login
- Automatic session termination on logout
- Automatic session termination on token revocation
- UserInfo endpoint session validation
-
Multi-tenancy Support
- Session management supports multi-tenant scenarios
- Tenant-isolated session storage
-
Configurable Session Persistence
- Support for configuring grant types that require session persistence
- Default support for password grant type
Installation
dotnet add package LINGYUN.Abp.OpenIddict.AspNetCore.Session
Usage
-
Add
[DependsOn(typeof(AbpOpenIddictAspNetCoreSessionModule))]to your module class. -
Configure session options:
Configure<IdentitySessionSignInOptions>(options =>
{
options.SignInSessionEnabled = true; // Enable login session
options.SignOutSessionEnabled = true; // Enable logout session
});
Configure<AbpOpenIddictAspNetCoreSessionOptions>(options =>
{
// Configure grant types that require session persistence
options.PersistentSessionGrantTypes.Add(GrantTypes.Password);
options.PersistentSessionGrantTypes.Add("custom_grant_type");
});
Workflow
-
User Login
- When a user successfully logs in through configured grant types
- System automatically creates and persists session information
-
Session Validation
- When user accesses the UserInfo endpoint
- System automatically validates if the session is valid
- Returns appropriate error if session has expired or is invalid
-
Session Termination
- Automatically terminates session on user logout
- Automatically terminates related sessions on token revocation
- Supports session management for multiple concurrent logins
Notes
- Session persistence only applies to configured grant types
- Session validation automatically switches tenant context in multi-tenant environments
- Token revocation will terminate related user sessions
- UserInfo endpoint session validation is mandatory, invalid sessions will result in request rejection