【发布时间】:2020-10-28 08:32:57
【问题描述】:
我在使用 IDS4 时遇到了一个奇怪的情况。
我有一个 Blazor WA 应用、API 和 IDS4。 Blazor 和 API 与 IDS4 挂钩,大部分情况下一切正常。您在 Blazor 中单击登录,它会将您发送到您进行身份验证的 IDS4,然后将您发送回 Blazor,然后您可以访问 API。都很好。
注册时除外。 Blazor 获取您的信息并生成注册电子邮件。用户点击调用 API 中验证令牌等方法的链接,然后将您发送到 IDS4 登录。当用户在这里登录时,它不会将您发送到生产 Blazor URL,而是将其发送到开发 URL,我不知道它是如何知道开发 URL 是什么的。这发生在任何机器上,而不仅仅是我的开发工作站。这是 appsettings.json。
"ConnectionStrings": {
"DefaultConnection": "Server=xxxxx;Database=xxxxxx;User Id=xxxxx;Password=xxxxxx"
},
"ClientURLs": {
"BlazorWA": "https://prodURL.azurewebsites.net/"
},
"IdentityServer": {
"Clients": [
{
"AllowOfflineAccess": true,
"AllowedCorsOrigins": "*",
"Enabled": true,
"RequireConsent": false,
"RequireClientSecret": false,
"RequirePkce": true,
"ClientId": "blazorWA",
"ClientName": "blazorWA",
"ClientUri": "https://prodURL.azurewebsites.net/",
"RedirectUris": [ "https://prodURL.azurewebsites.net/authentication/login-callback" ],
"AllowedGrantTypes": [ "authorization_code" ],
"AllowedScopes": [ "openid", "profile", "email", "appAPI" ],
"PostLogoutRedirectUris": [ "https://prodURL.azurewebsites.net/" ]
}
]
}
不知何故,只有从注册路径,当用户单击登录时,它会尝试转到“https://devURL....”
我唯一能想到的就是以某种方式读取 appsettings.Development.json?这有可能出版吗?但为什么有时它会起作用?
谢谢。
【问题讨论】:
-
这部署到 Azure btw。
标签: identityserver4 appsettings azure-appservice