forked from gongxuegit/tiku-backend.net
feat: add wechat authentication
This commit is contained in:
26
Tiku.Application/Auth/IWechatOAuthClient.cs
Normal file
26
Tiku.Application/Auth/IWechatOAuthClient.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace Tiku.Application.Auth;
|
||||
|
||||
public sealed record WechatProviderOptions(
|
||||
string AppId,
|
||||
string AppSecret);
|
||||
|
||||
public sealed record WechatIdentity(
|
||||
string OpenId,
|
||||
string? UnionId,
|
||||
string? Nickname,
|
||||
string? AvatarUrl,
|
||||
string? SessionKey,
|
||||
string RawJson);
|
||||
|
||||
public interface IWechatOAuthClient
|
||||
{
|
||||
Task<WechatIdentity> ExchangeWebCodeAsync(
|
||||
WechatProviderOptions options,
|
||||
string code,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<WechatIdentity> ExchangeMiniAppCodeAsync(
|
||||
WechatProviderOptions options,
|
||||
string code,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user