我正在尝试构建多个连接到使用IdentityServer4构建的Identity Server的小型ASP.Net核心Mvc服务。IdentityServer 4,OpenIdConnect重定向到外部登录URL
我已经安装,看起来像这样
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationScheme = "Cookies"
});
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
AuthenticationScheme = "oidc",
SignInScheme = "Cookies",
Authority = "http://localhost:5000",
RequireHttpsMetadata = false,
ClientId = "mvc",
ClientSecret = "secret",
ResponseType = "code id_token",
Scope = { "api1", "offline_access" },
GetClaimsFromUserInfoEndpoint = true,
SaveTokens = true
});
其中http://localhost:5000
的MVC服务OpenIdOption是上我的身份运行服务器的端点。说,如果我的MVC的服务器是在http://localhost:5002
我看到,当我设置[Authorize]
属性控制器,它重定向到我的身份服务器,如果校验失败,它会寻找登录页面回http://localhost:5002/signin-oidc
现在的问题我有我是登录页面托管在我的Identity Server
http://localhost:5000/signin-oidc
,以便所有的MVC服务只是利用这个来获取用户身份,但不幸的是我无法看到如何设置RedirectUrl
。
我知道这个图是如何参照工程的流量不准确的,只是想简化我要完成:)
是有可能做到这一点呢?
问候 基兰
谢谢!这真的拯救了我的一天。我对Identity Server客户端属性上的'RedirectUris'感到困惑。当这是不正确的,我没有看到登录页面,所以我认为这是一个回电。 – Kiran