本文介绍了AdalException:parsing_wstrust_response_failed的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

Hi all,

 

我在为联合用户WS-Trust获取令牌时遇到问题:

I'm having a problem to acquire a token for federated user WS-Trust:


  var凭据=新的UserPasswordCredential(用户名,密码);               
  var authenticationContext =新的AuthenticationContext(AuthorityUrl);

 var credential = new UserPasswordCredential(Username, Password);               
 var authenticationContext = new AuthenticationContext(AuthorityUrl);

  var authenticationResult =等待authenticationContext.AcquireTokenAsync(ResourceUrl,ClientId,凭据);

 var authenticationResult = await authenticationContext.AcquireTokenAsync(ResourceUrl, ClientId, credential);

将应用程序部署到Azure Web App时,出现下一个错误:

When deploying the app to Azure Web App, I'm receiving the next error: 

Microsoft.IdentityModel.Clients.ActiveDirectory.AdalException:parsing_wstrust_response_failed:在Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.WsTrust.WsTrustResponse.CreateFromResponseDocument(XDocument responseDocument, WsTrustVersion版本),位于Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.WsTrust.WsTrustRequest.d__3.MoveNext()

Microsoft.IdentityModel.Clients.ActiveDirectory.AdalException: parsing_wstrust_response_failed: Parsing WS-Trust response failed at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.WsTrust.WsTrustResponse.CreateFromResponseDocument(XDocument responseDocument, WsTrustVersion version) at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.WsTrust.WsTrustRequest.d__3.MoveNext() 

上面的代码在开发环境中以及也在Azure中的Stage Web应用程序中运行.

The above code is working in dev environment and in a stage web application that is also in Azure.

什么会导致此错误?

谢谢

推荐答案


这篇关于AdalException:parsing_wstrust_response_failed的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 11:21