这是基于vue-vben-admin 模板适用于abp vNext的前端管理项目
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.0 KiB

LINGYUN.Abp.Identity.AspNetCore.Session

User session login extension module, mainly handling login/logout events provided by AspNetCore.Identity to manage sessions.

Due to module responsibility separation principle, please do not confuse with LINGYUN.Abp.Identity.Session.AspNetCore module.

Configuration Usage

[DependsOn(typeof(AbpIdentityAspNetCoreSessionModule))]
public class YouProjectModule : AbpModule
{
  // other
}

Features

  • Extends AbpIdentityAspNetCoreModule module
  • Provides session management functionality in AspNetCore environment
  • Custom authentication service implementation
  • Integrates with AspNetCore.Identity login/logout events

Service Implementation

  • AbpIdentitySessionAuthenticationService - Custom authentication service
    • Handles user login/logout events
    • Manages user session state
    • Integrates with Identity session system

Basic Usage

  1. Configure authentication service
public override void ConfigureServices(ServiceConfigurationContext context)
{
    context.Services.AddTransient<IAuthenticationService, AbpIdentitySessionAuthenticationService>();
}
  1. Use authentication service
public class YourService
{
    private readonly IAuthenticationService _authenticationService;

    public YourService(IAuthenticationService authenticationService)
    {
        _authenticationService = authenticationService;
    }

    public async Task SignInAsync(HttpContext context, string scheme, ClaimsPrincipal principal, AuthenticationProperties properties)
    {
        await _authenticationService.SignInAsync(context, scheme, principal, properties);
    }

    public async Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties)
    {
        await _authenticationService.SignOutAsync(context, scheme, properties);
    }
}

More Information