利豪揪痧视频,医仙王妃,苏州解静聆照片
客户端可以从你的IDS服务器请求tokens。
通常,客户端需要遵循下面的通用设置:
一个唯一的Client ID
如果需要还可以提供密码
允许与token服务交互(授权类型)
identity 和/或 token被发送到的网络位置(redirect URI)
客户端允许访问的scopes清单(resources)
Note:
在运行时,客户端通过实现IClientStore来检索。它允许在任意数据资源中加载比如配置文件或者数据库。此文档将使用内存版本进行客户端存储。你可以在ConfigureServices通过AddInMemoryClients额外方法连接内存存储。
在这种情况(scenario)下没有交互用户,服务端(这里是客户端)想和API(Scope)通信:
public class Clients { public static IEnumerable<Client> Get() { return new List<Client> { new Client { ClientId = "service.client", ClientSecrets = { new Secret("secret".Sha256()) }, AllowedGrantTypes = GrantTypes.ClientCredentials, AllowedScopes = { "api1", "api2.read_only" } } }; } }
var jsClient =new Client { ClientId="js", ClientName="" ClientName = "JavaScript Client", ClientUri = "http://identityserver.io", AllowedGrantTypes = GrantTypes.Implicit, AllowAccessTokensViaBrowser = true, RedirectUris = { "http://localhost:7017/" }, PostLogoutRedirectUris = { "http://localhost:7017/" }, AllowedCorsOrigins = { "http://localhost:7017" }, AllowedScopes = { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, IdentityServerConstants.StandardScopes.Email, "api1", "api2.read_only" } }
交互式服务器端(或本地桌面/移动)应用程序使用混合流。此流程为您提供最佳的安全性,因为访问令牌仅通过反向通道呼叫传输(并允许您访问刷新令牌)
var mvcClient = new Client { ClientId = "mvc", ClientName = "MVC Client", ClientUri = "http://identityserver.io", AllowedGrantTypes = GrantTypes.Hybrid, AllowOfflineAccess = true, ClientSecrets = { new Secret("secret".Sha256()) }, RedirectUris = { "http://localhost:21402/signin-oidc" }, PostLogoutRedirectUris = { "http://localhost:21402/" }, FrontChannelLogoutUri = "http://localhost:21402/signout-oidc", AllowedScopes = { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, IdentityServerConstants.StandardScopes.Email, "api1", "api2.read_only" }, };
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论