gpt4 book ai didi

c# - 登录失败,因为 AudienceUris 中不存在指定的受众

转载 作者:可可西里 更新时间:2023-11-01 09:01:08 25 4
gpt4 key购买 nike

我有一个 web 应用程序,它会登录请求/发送到我的 ADFS 服务器。在返回时它被定向到另一个应用程序 url;我在 IIS 服务器中配置的。 IE。在 ADFS 服务器中也配置了相同的 url。

此错误信息如下

ID1038: The AudienceRestrictionCondition was not valid because thespecified Audience is not present in AudienceUris.Audience:

这是代码。为什么会这样失败?

issuerLocation = "https://test12.login.mytest.edu/adfs/ls/";
realm = "https://domain/SSO_Test/";
this.Request.Url.AbsoluteUri.Remove(this.Request.Url.AbsoluteUri.IndexOf(this.Request.Url.Query, StringComparison.OrdinalIgnoreCase));
var contextId = Guid.NewGuid().ToString();
this.CreateContextCookie(contextId, this.Request.Url.AbsoluteUri);

var message = new SignInRequestMessage(new Uri(issuerLocation), realm)
{
CurrentTime = DateTime.UtcNow.ToString("s", CultureInfo.InvariantCulture) + "Z",
};

this.Response.Redirect(message.RequestUrl, false);

最佳答案

如果我理解你的情况,你有一个依赖方(你的网络应用程序)发送到身份提供者(ADFS 服务器),一旦依赖方(你的网络应用程序)通过身份验证,你就会将用户重定向到另一个应用程序。

错误引用了依赖方的配置文件 AudienceUri 部分。值可能丢失或拼写错误:

<configuration>
<system.identityModel>
<identityConfiguration>
<audienceUris>
<add value="http://**YourSiteHere**/" />
</audienceUris>
</identityConfiguration>
</system.identityModel>
</configuration>

HTH

关于c# - 登录失败,因为 AudienceUris 中不存在指定的受众,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23032721/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com