This is a bug I believe, and it took me 2-3 days to figure it out. Please do the following to get it working,
2018-02-20 15:17
701 查看
This is a bug I believe, and it took me 2-3 days to figure it out. Please do the following to get it working,
1) Remove the "?api-version=1.0" from your URL. I know it sounds strange but trust me their documentation is a mess.
2) Add a "Content-Type": "application/x-www-form-urlencoded" header in your request (hence you'll have to encode the post data values ... for example redirect_url=(encodedURL) etc
3) Remove unnecessary fields from post data REFER ... it should be like
I see you have done point 2 so you'll need to do point 1 and you're good to go.
Furthermore, if you want to get access_token quickly(if nothing I said works for you), then pass "client_credentials" in grant_type and you'll get a smaller response with access_token. But if you want the complete response with refresh_token as well, you'll have to do all those steps.
EDIT: There is one more mistake in their documentation, for Refresh Tokens >>> the URL should be oauth2/token and NOT oauth2/authorize
1) Remove the "?api-version=1.0" from your URL. I know it sounds strange but trust me their documentation is a mess.
2) Add a "Content-Type": "application/x-www-form-urlencoded" header in your request (hence you'll have to encode the post data values ... for example redirect_url=(encodedURL) etc
3) Remove unnecessary fields from post data REFER ... it should be like
{ 'grant_type': "authorization_code", 'resource': "your resource", 'client_id': "your client Id", 'redirect_uri': "your redirect URL", 'client_secret': "your client secret", 'code': "the code u got" }
I see you have done point 2 so you'll need to do point 1 and you're good to go.
Furthermore, if you want to get access_token quickly(if nothing I said works for you), then pass "client_credentials" in grant_type and you'll get a smaller response with access_token. But if you want the complete response with refresh_token as well, you'll have to do all those steps.
EDIT: There is one more mistake in their documentation, for Refresh Tokens >>> the URL should be oauth2/token and NOT oauth2/authorize
相关文章推荐
- Working on your thesis: how to get started and how to keep it going?
- How to create a StackOverflowException. And how to figure out where it is happening.
- 布置Git环境Your working copy is out of date. Try pulling from the remote to get the latest change
- The database schema is too old to perform this operation in this SharePoint cluster. Please upgrade the database and...
- What is the PPA and How to do with it ?
- Xcode4 布置Git环境Your working copy is out of date. Try pulling from the remote to get the latest change
- Xcode4 布置Git环境Your working copy is out of date. Try pulling from the remote to get the latest change
- linux下安装PHP的CI框架,出现Your view folder path does not appear to be set correctly. Please open the following file and correct this: i
- vyos bug - a tcp flow is working, and it will also working at the step you change the port or other
- This function has none of Deterministic,no sql,or reads sql data in its declaration and binary logging is enabled(you *might* want to use the less safe log_bin_trust_function_creators variable
- Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings.
- 全网最详细使用Scrapy时遇到0: UserWarning: You do not have a working installation of the service_identity module: 'cannot import name 'opentype''. Please install it from ..的问题解决(图文详解)
- Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically a
- The first day of working--everything is fresh to me--I am a super person!
- The important thing in life is to have a great aimand the determination to attain it.
- A man speaks truth 3 out of 4 times. He throws a die and reports it to be a 6. What is the probabili
- Photoshop CS2 RAW : Using Adobe Camera Raw, Bridge, and Photoshop to Get the Most out of Your Digita
- 发布应用到App Store问题:The CodeResources file is missing and it must be a symbolic link to _CodeSignature
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit
- 提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit