[英]IdentityServer4 How does oidc know where to redirect to from configuration
我正在運行IdentityServer4的Javascript Client示例,其配置如下所示:
var config = {
authority: "https://localhost:44350",
client_id: "Js",
redirect_uri: "http://localhost:5003/callback.html",
response_type: "id_token token",
scope:"openid profile Api1",
post_logout_redirect_uri : "http://localhost:5003/index.html",
};
單擊“登錄”按鈕時,授權機構指向我的IdentityServer4實例,我被重定向到項目中的“ Account/Login
路由。
我正在尋找每個地方,但仍看不到重定向到該路由的位置或方式,該配置在哪里?
它知道,因為存在與交互URL的映射,這些URL被指定為IdentityServer Options的一部分。 要配置這些url以匹配您的控制器,您可以在ConfigureServices
執行以下ConfigureServices
:
services.AddIdentityServer(options =>
{
options.UserInteraction = new UserInteractionOptions
{
//ensure that the url strings have a leading slash
LoginUrl = "/foo/bar",<-foo/bar maps to your controller in charge of route [foo/bar]
LogoutUrl = "/baz"
}
}
希望這可以幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.