本篇文章为大家探讨IdentityServer4 授权配置AllowedScopes的方法的解决方法,文章内容质量较高,有需要的朋友可以学习和借鉴。
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的方法-创新互联
文章出自:https://www.cdcxhl.com/article18/codogp.html
成都网站建设公司_创新互联,为您提供网站制作、虚拟主机、服务器托管、商城网站、小程序开发、ChatGPT
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联