java "error_description":"AADSTS70002: 请求正文必须包含以下参数:'client_secret or client_assertion'
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40858689/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"error_description":"AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'
提问by Anil Shekhar
I used the code in https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/master/src/samples/public-client-app-sample/src/main/java/PublicClient.java. The only difference is the CLIENT_ID is updated.
我使用了https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/master/src/samples/public-client-app-sample/src/main/java/PublicClient.java 中的代码. 唯一的区别是更新了 CLIENT_ID。
I keep getting the error message
我不断收到错误消息
"error_description":"AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'
"error_description":"AADSTS70002: 请求正文必须包含以下参数:'client_secret or client_assertion'
I am not sure how and where to specify this? Is there something that needs to be done in the configuration of the client by the admin?
我不确定如何以及在哪里指定这个?管理员在客户端的配置中有什么需要做的吗?
回答by Wei WANG
Had the same issue and finally resolved. In my case I was using the Redirect URI(like a common web URL) copied from Web application section in dev console, which made the server "think" the request was from a web client. After changing to the Redirect URI(something in format of urn:ietf:wg:oauth:2.0:oob, which means it's from a native client) from the application section, my Android app finally worked.
遇到了同样的问题,终于解决了。就我而言,我使用的是从开发控制台中的 Web 应用程序部分复制的重定向 URI(如常见的 Web URL),这使服务器“认为”请求来自 Web 客户端。从应用程序部分更改为重定向 URI(格式为urn:ietf:wg:oauth:2.0:oob 的内容,这意味着它来自本机客户端)后,我的 Android 应用程序终于可以运行了。