36 lines
1.4 KiB
C#
36 lines
1.4 KiB
C#
using System.Text.Json;
|
|
using System.Security.Cryptography;
|
|
using System.Text;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.IdentityModel.Tokens;
|
|
using Tiku.Application.Auth;
|
|
using Tiku.Application.Security;
|
|
using Tiku.Application.Tenancy;
|
|
using Tiku.Domain.Identity;
|
|
using Tiku.Domain.Tenancy;
|
|
using Tiku.Infrastructure.Persistence;
|
|
|
|
namespace Tiku.Infrastructure.Auth;
|
|
|
|
public sealed partial class AuthService(
|
|
TikuDbContext dbContext,
|
|
SignInManager<User> signInManager,
|
|
UserManager<User> userManager,
|
|
ISmsVerificationService smsVerificationService,
|
|
IAuthSessionStore sessionStore,
|
|
IWechatOAuthClient wechatOAuthClient,
|
|
ITenantExternalProviderConfigService providerConfigService,
|
|
IFeatureAccessService featureAccessService) : IAuthService
|
|
{
|
|
private const string PasswordProvider = "password";
|
|
private const string SmsProvider = "sms";
|
|
private const string WechatWebProvider = "wechat_web";
|
|
private const string WechatMiniAppProvider = "wechat_miniapp";
|
|
private static readonly string[] WechatWebProviderAliases = ["wechat_web", "wechat-web", "wechat"];
|
|
private static readonly string[] WechatMiniAppProviderAliases = ["wechat-miniapp", "wechat_miniapp", "wechat-mini", "wechatMiniapp"];
|
|
private static readonly string[] WechatIdentityProviders = ["wechat_web", "wechat-web", "wechat", "wechat-miniapp", "wechat_miniapp", "wechat-mini", "wechatMiniapp"];
|
|
|
|
|
|
}
|