question

Mark N. avatar image
Mark N. asked

Android AVS + Profile scopes

Working with the SampleLoginWithAmazonApp as directed in the AVS tutorial Using the Login with Amazon SDK ( https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/docs/authorizing-your-alexa-enabled-product-from-an-android-or-ios-mobile-app) How do I request both alexa:all + profile scopes at the same time? Following the examples I was able to retrieve a AVS token: private static final String[] APP_SCOPES= {"alexa:all"}; private static final String scope_data = "{\"alexa:all\":{\"productID\":\"" + PRODUCT_ID + "\", \"productInstanceAttributes\":{\"deviceSerialNumber\":\"" + PRODUCT_DSN + "\"}}}"; Bundle options = new Bundle(); options.putString(AuthzConstants.BUNDLE_KEY.SCOPE_DATA.val, scope_data); options.putBoolean(AuthzConstants.BUNDLE_KEY.GET_AUTH_CODE.val, true); options.putString(AuthzConstants.BUNDLE_KEY.CODE_CHALLENGE.val, CODE_CHALLENGE); options.putString(AuthzConstants.BUNDLE_KEY.CODE_CHALLENGE_METHOD.val, "S256"); mAuthManager.authorize(APP_SCOPES, options, new AuthListener()); But this examples does not allow the access to the users profile. When I add "profile" to the app_scopes array I get :Error=invalid_scope error_description=lwa-invalid-parameter-bad-scope private static final String[] APP_SCOPES= {"alexa:all", "profile"}; Do I need to add something to the options bundle?
alexa voice service
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

elstryan@Amazon avatar image
elstryan@Amazon answered
You need to add the profile scope to the security profile that you are using in your AVS android application using the developer.amazon.com portal. The steps are as follows: 1) Log into developer.amazon.com 2) Click the APPS & SERVICES tab at the top 3) Select Login With Amazon and from the drop down select the security profile that you have associated with your AVS product 4) Click confirm 5) You will need to enter in a consent privacy notice url and consent logo image 6) Click Save (The reason that security profiles created through the Alexa sub tab of the developer portal don't have the profile scope is because we do not collect the privacy url and consent logo)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.