使用IDentityService4或Openiddict时,客户端在认证通过后,有时候依然无法访问服务端。常见的异常有:
1、认证服务器配置的认证URL与客户端调用的URL不匹配
2、Scope未被正确添加到服务端或客户端
3、ids4与Openiddict默认都需要https
附:IdentityModle客户端使用(密码模式)
var client = new HttpClient(); var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest() { Address = configuration.TokenEndpoint, GrantType = "password", ClientId = "myClient", ClientSecret = "123qwe", Scope= "testScope",//LE2QvO519zJH4EHcte2RgydoTnlEKVaYFuzadBT8rAA= UserName = account.UserName, Password = account.Password, });
标签:UserName,无法访问,Ids,认证,token,Openiddict,服务端,客户端 From: https://www.cnblogs.com/hanfeige/p/16902919.html