Seller Central
Seller Forums

Amazon Seller Forums » Login With Amazon » Login With Amazon Developers

Thread: refresh_token to get access_token - OA2UnsupportedGrantTypeException
This question is not answered.


Permlink Replies: 0 - Pages: 1
AZ Campaign Man...

Posts: 2
Registered: 05 Oct, 16 12:32 PM
Posted on: 09 Oct, 2016 8:19 AM  
Click to report abuse...   Click to reply to this thread Reply
I am trying to use the refresh_token received to get an updated access_token via an iOS app. I am not using the LWA SDK just making a standard POST call. When I try i get:

"Request failed: bad request (400)"
"x-amzn-ErrorType" = "OA2UnsupportedGrantTypeException:http://internal.amazon.com/coral/com.amazon.panda/";

here is my request:

NSMutableDictionary *params = [NSMutableDictionary alloc initWithObjectsAndKeys:
@"refresh_token",@"grant_type",
,@"client_id",
,@"refresh_token",
,@"client_secret",
nil];
NSLog(@"params: %@",params);
//make a connection to get refreshed access_token
AFHTTPSessionManager *manager = AFHTTPSessionManager manager;
NSMutableURLRequest *request = [;

;

The params are all translating and providing the data they should however, @"refresh_token",@"grant_type", is triggering unsupported grant type exception.

Any help would be greatly appreciated! Thanks in advnace!

also, here is the full connection error in case it helps:

Error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: bad request (400)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x1740385c0> { URL: https://api.amazon.com/auth/o2/token } { status code: 400, headers {
Connection = "keep-alive";
"Content-Encoding" = gzip;
"Content-Length" = 110;
"Content-Type" = "application/json";
Date = "Sun, 09 Oct 2016 15:07:21 GMT";
Server = Server;
Vary = "Accept-Encoding,User-Agent";
"X-Amz-Date" = "Sun, 09 Oct 2016 15:07:21 GMT";
"x-amzn-ErrorType" = "OA2UnsupportedGrantTypeException:http://internal.amazon.com/coral/com.amazon.panda/";
"x-amzn-RequestId" = "14229aea-8e32-11e6-9093-b502ce3318f7";
} }, NSErrorFailingURLKey=https://api.amazon.com/auth/o2/token, com.alamofire.serialization.response.error.data=<7b226572 726f725f 64657363 72697074 696f6e22 3a225468 65206175 74686f72 697a6174 696f6e20 6772616e 74207479 70652069 73206e6f 74207375 70706f72 74656420 62792074 68652061, ,

Jason
Is this a helpful question? Yes 0   No
0 Replies
Sort replies by: