添加OAuth2认证相关配置文件和服务实现,包括环境变量配置、PKCE流程支持、token管理等功能。主要变更: - 新增OAuth2配置文件 - 实现OAuth2服务层 - 更新请求拦截器支持token自动刷新 - 修改认证API和store以支持OAuth2流程
17 lines
641 B
C#
17 lines
641 B
C#
using Fengling.AuthService.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Design;
|
|
|
|
namespace Fengling.AuthService.Data;
|
|
|
|
public class ApplicationDbContextFactory : IDesignTimeDbContextFactory<ApplicationDbContext>
|
|
{
|
|
public ApplicationDbContext CreateDbContext(string[] args)
|
|
{
|
|
var optionsBuilder = new DbContextOptionsBuilder<ApplicationDbContext>();
|
|
optionsBuilder.UseNpgsql("Host=192.168.100.10;Port=5432;Database=fengling_auth;Username=movingsam;Password=sl52788542");
|
|
optionsBuilder.UseOpenIddict();
|
|
return new ApplicationDbContext(optionsBuilder.Options);
|
|
}
|
|
}
|