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.9 KiB
2.9 KiB
LINGYUN.Abp.OpenIddict.WeChat.Work
Introduction
LINGYUN.Abp.OpenIddict.WeChat.Work is a WeChat Work (Enterprise WeChat) authentication extension module based on OpenIddict, supporting WeChat Work authentication flow.
Features
-
WeChat Work Authentication
- Support WeChat Work authorization login
- Support automatic new user registration
- Support cross-tenant authentication
- Support security logging
-
User Management Integration
- Support WeChat Work account binding
- Support account lockout policy
- Support failed attempt counting
-
Security Logging
- Record login attempts
- Record authentication failures
- Record account lockouts
-
Localization Support
- Integrated with ABP localization framework
- Support custom error messages
Installation
dotnet add package LINGYUN.Abp.OpenIddict.WeChat.Work
Usage
-
Add
[DependsOn(typeof(AbpOpenIddictWeChatWorkModule))]to your module class. -
Configure OpenIddict server:
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<OpenIddictServerBuilder>(builder =>
{
// Allow WeChat Work authentication flow
builder.AllowWeChatWorkFlow();
});
}
- Usage example:
WeChat Work Authentication:
POST /connect/token
Content-Type: application/x-www-form-urlencoded
grant_type=wechat_work&
agent_id=1000001&
code=021iZ1Ga1TpLOB0dXJIa1Zr6RR1iZ1G7&
scope=openid profile wechat_work
Parameters
-
agent_id (required)
- WeChat Work application ID
- Must be a valid WeChat Work application ID
-
code (required)
- WeChat Work authorization code
- Must be a valid WeChat Work authorization code
-
scope (optional)
- Requested permission scopes
- Defaults include openid profile wechat_work
Error Codes
- invalid_grant
- GrantTypeInvalid - Authorization type not allowed
- WeChatTokenInvalid - WeChat Work authentication failed
- AgentIdOrCodeNotFound - Application ID or authorization code empty or not found
- UserIdNotRegister - User WeChat Work account not bound
Notes
- Must configure correct WeChat Work application ID and secret
- Must configure correct WeChat Work enterprise ID
- Authorization codes have limited validity
- Multiple authentication failures may lead to account lockout
- All authentication operations are recorded in security logs
- HTTPS is recommended in production environments