我正在嘗試構建多個連接到使用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