Hi,
Trying to implement the new requirements from Amazon to pump our users to the new AVS hosted splash scope by adding the new "alexa:voice_service:pre_auth" scope to the "alexa:all" scope for our hybrid Android app.
https://developer.amazon.com/docs/alexa-voice-service/authorize-companion-app.html
However we're seeing this exception:
W/ContextImpl( 1165): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1165 android.content.ContextWrapper.sendBroadcast:365 com.android.systemui.statusbar.phone.PhoneStatusBar.updateAppMessage:1658 com.android.systemui.statusbar.phone.PhoneStatusBar.updateAppMessage:1650 com.android.systemui.statusbar.phone.PhoneStatusBar.removeNotification:2300
W/System.err(26498): java.net.MalformedURLException: Unknown protocol: amzn
W/System.err(26498): at java.net.URL.<init>(URL.java:182)
W/System.err(26498): at java.net.URL.<init>(URL.java:125)
W/System.err(26498): at com.android.browser.iI.a(UrlHandler.java:100)
W/System.err(26498): at com.android.browser.bE.a(Controller.java:1666)
W/System.err(26498): at com.android.browser.hP.shouldOverrideUrlLoading(Tab.java:898)
W/System.err(26498): at com.miui.com.android.webview.chromium.WebViewContentsClientAdapter.shouldOverrideUrlLoading(WebViewContentsClientAdapter.java:346)
W/System.err(26498): at com.miui.org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:261)
W/System.err(26498): at com.miui.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
W/System.err(26498): at com.miui.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:48)
W/System.err(26498): at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err(26498): at android.os.Looper.loop(Looper.java:136)
W/System.err(26498): at android.app.ActivityThread.main(ActivityThread.java:5052)
W/System.err(26498): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(26498): at java.lang.reflect.Method.invoke(Method.java:515)
W/System.err(26498): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
W/System.err(26498): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
W/System.err(26498): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
W/System.err(26498): at dalvik.system.NativeStart.main(Native Method)
D/SystemAdController( 1382): Activity:ActivityInfo{42c02a40 com.amazon.identity.auth.device.workflow.WorkflowActivity}is not the default one
D/AdClientRecord( 1382): Splash target was not initialized.
D/SystemAdController( 1382): Package:com.buddytalk.setup01 is not in the list
D/SystemAdController( 1382): requestSplashScreen duration:1
I/ActivityManager( 1089): START u0 {act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=amzn://com.buddytalk.setup01?error_description=An+unknown+scope+was+requested&state=clientId=amzn1.application-oa2-client.2ab09a87dbb94c3ab7dcdfff5267c196&redirectUri=amzn://com.buddytalk.setup01&clientRequestId=6fdf4ed7-7db0-4bfb-b118-7eb8b4febcd9∬eractiveRequestType=com.amazon.identity.auth.device.authorization.request.authorize&com.amazon.identity.auth.device.authorization.return_auth_code=true&error=invalid_scope cmp=com.buddytalk.setup01/com.amazon.identity.auth.device.workflow.WorkflowActivity (has extras)} from pid 26498
...
D/com.amazon.identity.auth.device.api.workflow.RequestContext(26017): RequestContext b6200f14-e91e-4897-b6f8-cf363a546a9e: onResume
D/com.amazon.identity.auth.device.interactive.GenericInteractiveState(26017): InteractiveState 66c534e8-b828-4e88-8649-d5a540f90e4c: Processing request 6fdf4ed7-7db0-4bfb-b118-7eb8b4febcd9
D/com.amazon.identity.auth.device.ResponseManager(26017): Dequeuing pending response for request ID 6fdf4ed7-7db0-4bfb-b118-7eb8b4febcd9
D/com.amazon.identity.auth.device.api.workflow.RequestContext.PII(26017): RequestContext b6200f14-e91e-4897-b6f8-cf363a546a9e: processing response:<obscured>
D/com.amazon.identity.auth.device.RequestManager.PII(26017): Handling response for request 6fdf4ed7-7db0-4bfb-b118-7eb8b4febcd9:<obscured>
D/com.amazon.identity.auth.device.authorization.AuthorizationResponseProcessor.PII(26017): Received response from WebBroswer for OAuth2 flow:<obscured>
D/com.amazon.identity.auth.device.authorization.AuthorizationResponseParser.PII(26017): Received response from OAuth2 flow:<obscured>
D/com.amazon.identity.auth.device.authorization.AuthorizationResponseParser.PII(26017): Code extracted from response:<obscured>
D/AmazonLoginPlugin(26017): There was an error during the attempt to authorize the application
D/AmazonLoginPlugin(26017): ERROR_SERVER_REPSONSE
D/AmazonLoginPlugin(26017): INTERNAL
D/AmazonLoginPlugin(26017): AuthError cat= INTERNAL type=ERROR_SERVER_REPSONSE - com.amazon.identity.auth.device.AuthError: Error=invalid_scope error_description=An unknown scope was requested
Wondering if we're doing something wrong?
Our code is doing this:
public void run() {
AuthorizationManager.authorize(new AuthorizeRequest
.Builder(mRequestContext)
.addScope(alexaScope(mProductID, mProductDSN))
.addScopes(computeScopes(mScopeFlag))
.forGrantType(AuthorizeRequest.GrantType.AUTHORIZATION_CODE)
.withProofKeyParameters(mCodeChallenge, CODE_CHALLENGE_METHOD)
.build());
}
where addScope() adds the "alexa:all" scope with the required product ID and serial number and addScopes() injects all the other additional scopes... in this case the new AVS splash screen one. Does our app need to handle any new browser custom URL schemes?!
Thanks!
PS: LWA works fine and current app is able to register our AVS ready device online. Only this new requirement is failing. Our device has no Alexa app.