ADAL: The request body must contain the following parameter: client_secret

半城伤御伤魂 提交于 2019-11-30 18:56:10

问题


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 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.

Server error message:

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/26846357/adal-the-request-body-must-contain-the-following-parameter-client-secret

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!