这是基于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.3 KiB

LINGYUN.Abp.IdentityServer.Portal

IdentityServer portal authentication module that provides enterprise portal authentication functionality.

Features

  • Portal Authentication

    • PortalGrantValidator - Portal Grant Validator
      • Supports enterprise portal login
      • Supports multi-tenant authentication
      • Automatic tenant switching
      • Enterprise information validation
      • User password validation
      • Security log recording
  • Authentication Flow

    1. User initiates login request using portal
    2. Check if enterprise identifier (EnterpriseId) is provided
      • Without EnterpriseId: Returns list of enterprises with tenant information
      • With EnterpriseId: Retrieves associated tenant information and switches to specified tenant
    3. Performs login validation using password method
    4. Returns token upon successful login

Module Reference

[DependsOn(
    typeof(AbpIdentityServerPortalModule)
)]
public class YourModule : AbpModule
{
    // ...
}

Dependencies

  • AbpIdentityServerDomainModule - ABP IdentityServer Domain Module
  • AbpAspNetCoreMultiTenancyModule - ABP Multi-tenancy Module
  • PlatformDomainModule - Platform Domain Module

Configuration and Usage

Configure Portal Authentication

public override void PreConfigureServices(ServiceConfigurationContext context)
{
    PreConfigure<IIdentityServerBuilder>(builder =>
    {
        builder.AddExtensionGrantValidator<PortalGrantValidator>();
    });
}

Authentication Request Parameters

  • grant_type: "portal" (required)
  • enterpriseId: Enterprise identifier (optional)
  • username: Username (required)
  • password: Password (required)
  • scope: Request scope (optional)

Authentication Response

  • When enterpriseId is not provided:
{
    "error": "invalid_grant",
    "enterprises": [
        {
            "id": "enterprise_id",
            "name": "enterprise_name",
            "code": "enterprise_code"
        }
    ]
}
  • On successful authentication:
{
    "access_token": "access_token",
    "expires_in": expiration_time,
    "token_type": "Bearer",
    "refresh_token": "refresh_token"
}

Related Documentation:

查看中文文档