4 changed files with 290 additions and 0 deletions
@ -0,0 +1,64 @@ |
|||||
|
# LINGYUN.Abp.Authentication.QQ |
||||
|
|
||||
|
QQ Connect authentication module, integrating QQ login functionality into ABP applications. |
||||
|
|
||||
|
## Features |
||||
|
|
||||
|
* QQ OAuth2.0 authentication |
||||
|
* Support for both mobile and PC login |
||||
|
* Retrieve basic QQ user information (nickname, gender, avatar, etc.) |
||||
|
* Integration with ABP identity system |
||||
|
|
||||
|
## Module Dependencies |
||||
|
|
||||
|
```csharp |
||||
|
[DependsOn(typeof(AbpAuthenticationQQModule))] |
||||
|
public class YouProjectModule : AbpModule |
||||
|
{ |
||||
|
// other |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Configuration |
||||
|
|
||||
|
```json |
||||
|
{ |
||||
|
"Authentication": { |
||||
|
"QQ": { |
||||
|
"AppId": "Your QQ Connect AppId", |
||||
|
"AppKey": "Your QQ Connect AppKey", |
||||
|
"IsMobile": false, // Enable mobile login page |
||||
|
"ClaimsIssuer": "connect.qq.com", // Optional, defaults to connect.qq.com |
||||
|
"CallbackPath": "/signin-qq", // Optional, defaults to /signin-qq |
||||
|
"Scope": ["get_user_info"] // Optional, defaults to get_user_info |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Basic Usage |
||||
|
|
||||
|
1. Configure QQ Connect Parameters |
||||
|
* Apply for an application on QQ Connect platform to get AppId and AppKey |
||||
|
* Configure AppId and AppKey in appsettings.json |
||||
|
|
||||
|
2. Add QQ Login |
||||
|
```csharp |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
context.Services.AddAuthentication() |
||||
|
.AddQQConnect(); // Add QQ login support |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Retrieved User Information |
||||
|
|
||||
|
* OpenId - Unique QQ user identifier |
||||
|
* NickName - User's nickname |
||||
|
* Gender - User's gender |
||||
|
* AvatarUrl - User's avatar URL |
||||
|
|
||||
|
## More Information |
||||
|
|
||||
|
* [QQ Connect Documentation](https://wiki.connect.qq.com/) |
||||
|
* [ABP Authentication Documentation](https://docs.abp.io/en/abp/latest/Authentication) |
||||
@ -0,0 +1,64 @@ |
|||||
|
# LINGYUN.Abp.Authentication.QQ |
||||
|
|
||||
|
QQ互联认证模块,集成QQ登录功能到ABP应用程序。 |
||||
|
|
||||
|
## 功能特性 |
||||
|
|
||||
|
* QQ OAuth2.0认证 |
||||
|
* 支持移动端和PC端登录 |
||||
|
* 获取QQ用户基本信息(昵称、性别、头像等) |
||||
|
* 支持与ABP身份系统集成 |
||||
|
|
||||
|
## 模块引用 |
||||
|
|
||||
|
```csharp |
||||
|
[DependsOn(typeof(AbpAuthenticationQQModule))] |
||||
|
public class YouProjectModule : AbpModule |
||||
|
{ |
||||
|
// other |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## 配置项 |
||||
|
|
||||
|
```json |
||||
|
{ |
||||
|
"Authentication": { |
||||
|
"QQ": { |
||||
|
"AppId": "你的QQ互联AppId", |
||||
|
"AppKey": "你的QQ互联AppKey", |
||||
|
"IsMobile": false, // 是否启用移动端登录页面 |
||||
|
"ClaimsIssuer": "connect.qq.com", // 可选,默认为 connect.qq.com |
||||
|
"CallbackPath": "/signin-qq", // 可选,默认为 /signin-qq |
||||
|
"Scope": ["get_user_info"] // 可选,默认为 get_user_info |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## 基本用法 |
||||
|
|
||||
|
1. 配置QQ互联参数 |
||||
|
* 在QQ互联平台申请应用,获取AppId和AppKey |
||||
|
* 在appsettings.json中配置AppId和AppKey |
||||
|
|
||||
|
2. 添加QQ登录 |
||||
|
```csharp |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
context.Services.AddAuthentication() |
||||
|
.AddQQConnect(); // 添加QQ登录支持 |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## 获取的用户信息 |
||||
|
|
||||
|
* OpenId - QQ用户唯一标识 |
||||
|
* NickName - 用户昵称 |
||||
|
* Gender - 用户性别 |
||||
|
* AvatarUrl - 用户头像URL |
||||
|
|
||||
|
## 更多信息 |
||||
|
|
||||
|
* [QQ互联文档](https://wiki.connect.qq.com/) |
||||
|
* [ABP认证文档](https://docs.abp.io/en/abp/latest/Authentication) |
||||
@ -0,0 +1,81 @@ |
|||||
|
# LINGYUN.Abp.Authentication.WeChat |
||||
|
|
||||
|
WeChat Official Account authentication module, integrating WeChat Official Account login functionality into ABP applications. |
||||
|
|
||||
|
## Features |
||||
|
|
||||
|
* WeChat Official Account OAuth2.0 authentication |
||||
|
* Retrieve WeChat user information (nickname, gender, region, avatar, etc.) |
||||
|
* Support for UnionId mechanism, connecting Official Account and Mini Program account systems |
||||
|
* Support for WeChat server message verification |
||||
|
* Integration with ABP identity system |
||||
|
|
||||
|
## Module Dependencies |
||||
|
|
||||
|
```csharp |
||||
|
[DependsOn(typeof(AbpAuthenticationWeChatModule))] |
||||
|
public class YouProjectModule : AbpModule |
||||
|
{ |
||||
|
// other |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Configuration |
||||
|
|
||||
|
```json |
||||
|
{ |
||||
|
"Authentication": { |
||||
|
"WeChat": { |
||||
|
"AppId": "Your WeChat Official Account AppId", |
||||
|
"AppSecret": "Your WeChat Official Account AppSecret", |
||||
|
"ClaimsIssuer": "WeChat", // Optional, defaults to WeChat |
||||
|
"CallbackPath": "/signin-wechat", // Optional, defaults to /signin-wechat |
||||
|
"Scope": ["snsapi_login", "snsapi_userinfo"], // Optional, defaults to snsapi_login and snsapi_userinfo |
||||
|
"QrConnect": { |
||||
|
"Enabled": false, // Enable PC-side QR code login |
||||
|
"Endpoint": "https://open.weixin.qq.com/connect/qrconnect" // PC-side QR code login endpoint |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Basic Usage |
||||
|
|
||||
|
1. Configure WeChat Official Account Parameters |
||||
|
* Register an Official Account on WeChat Official Account Platform to get AppId and AppSecret |
||||
|
* Configure AppId and AppSecret in appsettings.json |
||||
|
|
||||
|
2. Add WeChat Login |
||||
|
```csharp |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
context.Services.AddAuthentication() |
||||
|
.AddWeChat(); // Add WeChat login support |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
3. Enable WeChat Server Message Verification (Optional) |
||||
|
```csharp |
||||
|
public void Configure(IApplicationBuilder app) |
||||
|
{ |
||||
|
app.UseWeChatSignature(); // Enable WeChat server message verification middleware |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## Retrieved User Information |
||||
|
|
||||
|
* OpenId - Unique WeChat user identifier |
||||
|
* UnionId - WeChat Open Platform unique identifier (requires binding to Open Platform) |
||||
|
* NickName - User's nickname |
||||
|
* Sex - User's gender |
||||
|
* Country - User's country |
||||
|
* Province - User's province |
||||
|
* City - User's city |
||||
|
* AvatarUrl - User's avatar URL |
||||
|
* Privilege - User's privilege information |
||||
|
|
||||
|
## More Information |
||||
|
|
||||
|
* [WeChat Official Account Platform Documentation](https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html) |
||||
|
* [ABP Authentication Documentation](https://docs.abp.io/en/abp/latest/Authentication) |
||||
@ -0,0 +1,81 @@ |
|||||
|
# LINGYUN.Abp.Authentication.WeChat |
||||
|
|
||||
|
微信公众号认证模块,集成微信公众号登录功能到ABP应用程序。 |
||||
|
|
||||
|
## 功能特性 |
||||
|
|
||||
|
* 微信公众号OAuth2.0认证 |
||||
|
* 支持获取微信用户基本信息(昵称、性别、地区、头像等) |
||||
|
* 支持UnionId机制,打通公众号与小程序账号体系 |
||||
|
* 支持微信服务器消息验证 |
||||
|
* 支持与ABP身份系统集成 |
||||
|
|
||||
|
## 模块引用 |
||||
|
|
||||
|
```csharp |
||||
|
[DependsOn(typeof(AbpAuthenticationWeChatModule))] |
||||
|
public class YouProjectModule : AbpModule |
||||
|
{ |
||||
|
// other |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## 配置项 |
||||
|
|
||||
|
```json |
||||
|
{ |
||||
|
"Authentication": { |
||||
|
"WeChat": { |
||||
|
"AppId": "你的微信公众号AppId", |
||||
|
"AppSecret": "你的微信公众号AppSecret", |
||||
|
"ClaimsIssuer": "WeChat", // 可选,默认为 WeChat |
||||
|
"CallbackPath": "/signin-wechat", // 可选,默认为 /signin-wechat |
||||
|
"Scope": ["snsapi_login", "snsapi_userinfo"], // 可选,默认包含 snsapi_login 和 snsapi_userinfo |
||||
|
"QrConnect": { |
||||
|
"Enabled": false, // 是否启用PC端扫码登录 |
||||
|
"Endpoint": "https://open.weixin.qq.com/connect/qrconnect" // PC端扫码登录地址 |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## 基本用法 |
||||
|
|
||||
|
1. 配置微信公众号参数 |
||||
|
* 在微信公众平台申请公众号,获取AppId和AppSecret |
||||
|
* 在appsettings.json中配置AppId和AppSecret |
||||
|
|
||||
|
2. 添加微信登录 |
||||
|
```csharp |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
context.Services.AddAuthentication() |
||||
|
.AddWeChat(); // 添加微信登录支持 |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
3. 启用微信服务器消息验证(可选) |
||||
|
```csharp |
||||
|
public void Configure(IApplicationBuilder app) |
||||
|
{ |
||||
|
app.UseWeChatSignature(); // 启用微信服务器消息验证中间件 |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## 获取的用户信息 |
||||
|
|
||||
|
* OpenId - 微信用户唯一标识 |
||||
|
* UnionId - 微信开放平台唯一标识(需要绑定开放平台) |
||||
|
* NickName - 用户昵称 |
||||
|
* Sex - 用户性别 |
||||
|
* Country - 国家 |
||||
|
* Province - 省份 |
||||
|
* City - 城市 |
||||
|
* AvatarUrl - 用户头像URL |
||||
|
* Privilege - 用户特权信息 |
||||
|
|
||||
|
## 更多信息 |
||||
|
|
||||
|
* [微信公众平台开发文档](https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html) |
||||
|
* [ABP认证文档](https://docs.abp.io/en/abp/latest/Authentication) |
||||
Loading…
Reference in new issue