具有Angular Client App的Identity Server

时间:2018-05-12 13:51:41

标签: angular identityserver4

我已经设置了部署在192.168.1.50和端口5000上的Identity Server 4.我部署了Angular 5客户端应用程序,比如192.168.1.60和端口4200.

我在Angular app中提供了以下内容作为客户端设置。

return {
    authority: 'http://192.168.1.50:5000/',
    client_id: 'client_app',
    redirect_uri: 'http://192.168.1.60:4200/auth-callback',
    post_logout_redirect_uri: 'http://192.168.1.60:4200/',
    response_type: 'id_token token',
    scope: 'openid profile api1, api2',
    filterProtocolClaims: true,
    loadUserInfo: true,
    automaticSilentRenew: true,
    silent_redirect_uri: 'http://192.168.1.60:4200/silent-refresh.html'
  };

我在Identity Server中提供了以下配置,

new Client {
     ClientId = "client_app",
     ClientName = "client_app_name",
     AllowedGrantTypes = GrantTypes.Implicit,
     AllowedScopes =  {
          IdentityServerConstants.StandardScopes.OpenId,
          IdentityServerConstants.StandardScopes.Profile,
          "api1",
          "api2",
     },
     RedirectUris = new List<string> { "http://192.168.1.60:4200/auth-callback" },
     PostLogoutRedirectUris = new List<string> { "http://192.168.1.60:4200" },
     AllowedCorsOrigins = new List<string> { "http://192.168.1.60:4200" },
     AllowAccessTokensViaBrowser = true,
     RequireConsent = false
}

上面给出了一个错误:

unauthorized_client Invalid redirect_uri

我做错了什么?我是否正确假设重定向URL的URL通常应该是客户端应用程序中的路径。大多数示例都将redirect_uri作为localhost。

非常感谢任何这方面的帮助。

提前致谢。

0 个答案:

没有答案
相关问题