我在集成外部提供商(即 Google)与 Thinktecture 身份服务器 v3 时遇到问题。我收到以下错误:“客户端应用程序未知或未授权。”
有人对这个错误有任何想法吗?
@Whoever,看起来客户端和服务器中的 RedirectUri 值不匹配。
客户端启动中的 RedirectUri 属性定义了身份服务器进行身份验证后将调用的 URI。服务器配置中的 RedirectUris 定义可以请求身份验证的允许 URI 的列表。因此,客户端启动 RedirectUri 必须包含在服务器的 RedirectUris 列表中。
看起来您的客户端的 RedirectUri 当前指向服务器的 URI。您的客户端是否在端口 46289 上运行?如果是这样,请尝试将客户端启动中的 RedirectUri 属性的值更改为https://本地主机:46289 https://localhost:46289。您可能还想尝试修改服务器的redirectUris 值以使用https 而不是http,假设您的客户端确实可以通过https 访问。
服务器客户端存储:
public static IEnumerable<Client> Get()
{
return new[] {
new Client {
Enabled = true,
ClientName = "MVC Client",
ClientId = "mvc",
Flow = Flows.Implicit,
RedirectUris = new List<string>{
"https://localhost:46289/" // client home url
客户端启动:
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
app.UseCookieAuthentication(new CookieAuthenticationOptions {
AuthenticationType = "Cookies"
});
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions {
Authority = "https://localhost:44300/identity",
ClientId = "mvc",
RedirectUri = "https://localhost:46289/", //must be in server's Client.RedirectUris
ResponseType = "id_token",
SignInAsAuthenticationType = "Cookies"
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)