本文介绍了ADAL:请求正文必须包含以下参数:client_secret的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ADAL为Android编写了以下身份验证代码:

I wrote the authentication code below with ADAL for android:

mAuthContext = new AuthenticationContext(MainActivity.this, Constants.AUTHORITY_URL,false);
mAuthContext.acquireToken(MainActivity.this, Constants.RESOURCE_ID, Constants.CLIENT_ID,Constants.REDIRECT_URL, Constants.USER_HINT, getCallback());

Windows Azure中国版(本地化版本)尚不支持将应用程序注册为本地客户端应用程序 ,根本没有选择。因此,当我运行上面的代码时,我仍然看到下面的错误。

Windows Azure China version(localized version) has not yet supported to register an app as "native client app", no option at all. So I continue seeing the error below when running the code above.

服务器错误消息:

{"error":"invalid_request","error_description":"AADSTS90014: The request body must contain the following parameter: 'client_secret or client_assertion.

在ADAL Android SDK中似乎没有关于 acquireToken凭据的参数。有人知道如何解决此问题吗?

It seems there's no parameters about credentials for "acquireToken" in ADAL Android SDK. Does anyone know how to workaround this?

推荐答案

似乎因为您无法添加幼稚的客户端应用程序,所以您创建了一个Web应用程序,该应用程序类似于OAuth协议中的机密客户端,这就是为什么它要求客户凭据。AndroidADAL当前不支持机密客户。

It seems since you could not add a naive client app, you have created a Web app instead which is analogous to confidential client in OAuth protocol. That is why it is asking for client credential. ADAL Android currently does not support confidential clients.

这篇关于ADAL:请求正文必须包含以下参数:client_secret的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 11:16