Ven*_*a V 5 azure-active-directory
当我尝试使用以下代码创建身份验证标头时.我收到错误消息"AADSTS70002:验证凭据时出错.AADSTS50012:提供了无效的客户端密码." 现在,我确信,我在代码中使用的秘密与我的AAD app注册中使用的秘密不匹配.任何人都可以通过我的应用程序注册或如何在我的O365帐户目录中添加新的应用程序标识符来帮助我了解客户机密.
private string GetAuthenticationHeader(AuthenticationInformation authenticationInformation){
try{
return RetryHelper.InvokeWithRetries(() =>
{
var clientCredential = new ClientCredential(authenticationInformation.ClientId, authenticationInformation.AppSecret);
var ac = new AuthenticationContext(authenticationInformation.Authority);
AuthenticationResult ar = ac.AcquireToken(authenticationInformation.Resource, clientCredential);
return ar.CreateAuthorizationHeader();
});
}
catch (Exception ex){
return ex.Message;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8407 次 |
| 最近记录: |