RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
IdentityServer4授权配置AllowedScopes的方法-创新互联

本篇文章为大家探讨IdentityServer4 授权配置AllowedScopes的方法的解决方法,文章内容质量较高,有需要的朋友可以学习和借鉴。

创新互联主要从事网站设计制作、成都网站建设、网页设计、企业做网站、公司建网站等业务。立足成都服务邹城,10余年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:028-869222201. 业务场景

IdentityServer4 授权配置Client中的AllowedScopes,设置的是具体的 API 站点名字,也就是使用方设置的ApiName,示例代码:

//授权中心配置new Client
{
    ClientId = "client_id_1",
    AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
    AllowOfflineAccess = true,
    AccessTokenLifetime = 3600 * 6, //6小时SlidingRefreshTokenLifetime = 1296000, //15天ClientSecrets =
    {new Secret("secret".Sha256())
    },
    AllowedScopes = 
    {"api_name1"},
}//API 服务配置app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
{
    Authority = $"http://localhost:5000",
    ApiName = "api_name1",
    RequireHttpsMetadata = false});

当前名称:IdentityServer4授权配置AllowedScopes的方法-创新互联
当前地址:http://sczitong.cn/article/codogp.html