如何使用Android的Alexa语音服务进行身份验证?

如何使用Android的Alexa语音服务进行身份验证?,第1张

概述我正在尝试按照此页面上的说明从 Android应用程序连接到Alexa语音服务. https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/docs/authorizing-your-alexa-enabled-product-from-an-android-or-ios-mobile-app Bundle op 我正在尝试按照此页面上的说明从 Android应用程序连接到Alexa语音服务. https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/docs/authorizing-your-alexa-enabled-product-from-an-android-or-ios-mobile-app

Bundle options = new Bundle();String scope_data = "{\"alexa:all\":{\"productID\":\"" + PRODUCT_ID +                    "\",\"productInstanceAttributes\":           {\"deviceSerialNumber\":\"" + PRODUCT_DSN + "\"}}}";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 AuthorizeListener());

首先,我不知道APP_ScopES应该是什么.我把它设置为:

protected static final String[] APP_ScopE = new String[]{"profile","postal_code"};

但我从服务器收到错误

AuthError cat= INTERNAL type=ERROR_SERVER_REPSONSE - com.amazon.IDentity.auth.device.AuthError: Error=invalID_scope error_description=An unkNown scope was requested
解决方法 APP_ScopE是:“alexa:all”

根据Joshua Frank(https://forums.developer.amazon.com/forums/message.jspa?messageID=18973#18973)的建议,PRODUCT_DSN可以是您想要的任何东西,“1234”

PRODUCT_ID是AVS Developper Portal(https://developer.amazon.com/edw/home.html#/avs/list)中的ID

CODE_CHALLENGE应用程序安全配置文件中的客户端密钥(应在S256中已经过哈希处理)

总结

以上是内存溢出为你收集整理的如何使用Android的Alexa语音服务进行身份验证?全部内容,希望文章能够帮你解决如何使用Android的Alexa语音服务进行身份验证?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1127884.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-30
下一篇2022-05-30

发表评论

登录后才能评论

评论列表(0条)

    保存