gpt4 book ai didi

c# - 无法在最新版本的 IdentityModel.Tokens 中设置有效受众

转载 作者:行者123 更新时间:2023-12-03 00:37:38 27 4
gpt4 key购买 nike

我已经更新了 System.IdentityModel.Tokens.jwt,它警告我在较低的代码块中使用“Audience”已过时。我做了一些研究,发现让观众前进的正确方法是:

var validationParameters = new TokenValidationParameters()
{
ValidAudience = ConfigurationManager.AppSettings["ida:AudienceUri"]
};

What I can't work out is how I join the two together?

public void ConfigureAuth(IAppBuilder app)
{
app.UseWindowsAzureActiveDirectoryBearerAuthentication(
new WindowsAzureActiveDirectoryBearerAuthenticationOptions
{
Audience = ConfigurationManager.AppSettings["ida:AudienceUri"],
//TokenValidationParameters.validAudience = ConfigurationManager.AppSettings["ida:AudienceUri"],
Tenant = ConfigurationManager.AppSettings["ida:Tenant"]
});


app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions()
{
});
app.UseWsFederationAuthentication(
new WsFederationAuthenticationOptions
{
Wtrealm = realm,
MetadataAddress = metadata
});
}

}

最佳答案

我已经尝试过这个:

 TokenValidationParameters = new TokenValidationParameters
{
ValidAudience = ConfigurationManager.AppSettings["ida:Audience"]
}

关于c# - 无法在最新版本的 IdentityModel.Tokens 中设置有效受众,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36970717/

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