ID1038:AudienceRestrictionCondition 无效,因为 AudienceUris 中不存在指定的受众

ID1038: The AudienceRestrictionCondition was not valid because the specified Audience is not present in AudienceUris

尝试创建我自己的 SAML 不记名令牌(模拟第 3 方)

var descriptor = new SecurityTokenDescriptor();
descriptor.AppliesToAddress = "what-should-I-put-here";

并将其从 ADFS 交换为 JWT,ADFS 给出错误

ID1038: The AudienceRestrictionCondition was not valid because the specified Audience is not present in AudienceUris

互联网上的其他答案将您指向 app.config 中的设置条目,但对于这种情况,这是一个转移注意力的问题。

正确的 AudienceUri 是具有特定路径的 ADFS 服务器:

descriptor.AppliesToAddress = "http://my-really-frustrating-adfs-server/adfs/services/trust"