Seller Central
Seller Forums

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

Thread: Get authorization code error
This question is answered.


Permlink Replies: 2 - Pages: 1 - Last Post: 29 Aug, 2017 1:56 AM by: longdick Threads: [ Previous | Next ]
longdick

Posts: 2
Registered: 15 Aug, 17 7:20 AM
Posted on: 15 Aug, 2017 2:42 AM  
Click to report abuse...   Click to reply to this thread Reply
My APIKey copied from app console,other request params are assigned a value with device info.

AMZNAuthorizeRequest *request = [AMZNAuthorizeRequest alloc] init;
NSDictionary *scopeData = @{@"productID": @"RK_ca218f29584c5edd0872a7c6da5928b4a0de79c12efa9440",
@"productInstanceAttributes": @{@"deviceSerialNumber":@"123456"}};
id<AMZNScope> alexaAllScope = ;
request.scopes = @alexaAllScope;
request.codeChallenge = @"U3DddAEJMGgEc-ovgkgp571_atqjX0UjfMXA5QRT-XM";
request.codeChallengeMethod = @"S256";
request.grantType = AMZNAuthorizationGrantTypeCode;
request.interactiveStrategy = AMZNInteractiveStrategyAlways;
AMZNAuthorizationManager *authManager = AMZNAuthorizationManager sharedManager;

NSLog(@"version = %@",AMZNLWASDKInfo sdkVersion);
[authManager authorize:request withHandler:^(AMZNAuthorizeResult *result, BOOL userDidCancel, NSError *error) {

}];

After send this request,I receive an error:
Error Domain=AMZNLWAErrorDomain Code=6 "(null)" UserInfo={AMZNLWAErrorNonLocalizedDescription=One or more input parameters are wrong.}

How do I know which parameter is wrong?

Is this a helpful question? Yes 0   No
2 Replies
Sort replies by:
Yancheng G. (LWA)

Posts: 26
Registered: 17 Jun, 14 4:37 PM
Posted on: 23 Aug, 2017 12:22 PM   in response to: longdick in response to: longdick  
Click to report abuse...   Click to reply to this thread Reply
Hello,

In order to request authorization for the alexa:all scope, you must have your mobile application registered with Alexa Voice Service. To do so, navigate to . After you’ve logged in, click Get Started > under Alexa Voice Service, then click Edit next to a registered product (or create a new one). From the left navigation select Security Profile. From there, select one of your existing security profile (or create a new one). Then click on the iOS tab, register your bundle ID and get an API key. Insert this API key to your iOS app and it should allow you to request for the scope.
Was this reply helpful? Yes 1   No 0
longdick

Posts: 2
Registered: 15 Aug, 17 7:20 AM
Posted on: 29 Aug, 2017 1:56 AM   in response to: Yancheng G. (LWA) in response to: Yancheng G. (LWA)  
Click to report abuse...   Click to reply to this thread Reply
thank you so much,I have understood!
Was this reply helpful? Yes 0   No 0