AbpVnext授权中心 和 资源服务器分开部署 流程 避开所有的坑

文章详细介绍了如何配置资源服务,包括CORSOrigins设置,以及在XXXtHttpApiHostModule.cs文件中进行的服务配置。同时,提到了授权中心的配置,如SelfUrl、ClientUrl和CorsOrigins,强调了IssuerUri和HTTPS安全设置的重要性。
摘要由CSDN通过智能技术生成

遇到的问题

资源服务的配置

{
  "App": {
    "CorsOrigins": "https://*.BlogMgt.com,http://localhost:8848,http://localhost:3000"
  },
  "AuthServer": {
  	// 重点  Authority 要指向 授权服务器的地址 部署后要是部署后的地址
    "Authority": "https://localhost:44357",
    // 指定颁发人 
    "IssuerUri": "https://xxxx.com:7073",
    // 如果关闭https 那么吧这个设置成false
    "RequireHttpsMetadata": "true",
    "SwaggerClientId": "BlogMgt_Swagger",
    "SwaggerClientSecret": "1q2w3e*"
  },
  "StringEncryption": {
    "DefaultPassPhrase": "Ry4RyvH5WNzXMLaV"
  }
}
2 代码配置
XXXtHttpApiHostModule.cs 文件下 添加 PostConfigureServices 并在  ConfigureServices 方法中引用
 public override void PostConfigureServices(ServiceConfigurationContext context)
    {
        var configuration = context.Services.GetConfiguration();
        // 配置IssuerUri 为指定颁发者
        PostConfigure<IdentityServerOptions>(options =>
        {
            options.IssuerUri = configuration["AuthServer:IssuerUri"];
        });
    }

授权中心的配置

{
"App": {
// SelfUrl 要对应上你部署的端口
  "SelfUrl": "https://localhost:44357",
  "ClientUrl": "http://localhost:8848",
  "CorsOrigins": "https://*.域名.com,http://localhost:8848,https://localhost:44332,https://localhost:44340",
  "RedirectAllowedUrls": "http://localhost:8848,https://localhost:44397,https://localhost:44332,https://localhost:44325"
},
"StringEncryption": {
  "DefaultPassPhrase": "Ry4RyvH5WNzXMLaV"
}
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值