且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

帐户与Azure AD关联后如何从Alexa获取访问令牌

更新时间:2023-02-15 08:16:00

听起来您还没有完成技能的帐户关联顺序。设置帐户链接配置后,您需要打开Alexa应用程序(在手机上或 https://alexa.amazon.com )并使用您的新技能并关联您的帐户。一旦成功,您将在 request.Session.User.AccessToken 中获得令牌。

It sounds like you haven't completed the account linking sequence for your skill. After setting the account linking configuration you need to open the Alexa app (on your phone or https://alexa.amazon.com) and go to your new skill and link your account. Once that is successful you will get a token in request.Session.User.AccessToken.

博客文章: > https://blogs.msdn.microsoft.com/premier_developer/2017/12/09/amazon-alexa-skills经Azure活动目录认证并由ASP-NET-core-2-0-web-api-Azure托管/ 支持的服务器需要更新以下内容:

The blog post: https://blogs.msdn.microsoft.com/premier_developer/2017/12/09/amazon-alexa-skills-authenticated-by-azure-active-directory-and-backed-by-asp-net-core-2-0-web-api-hosted-on-azure/ needs to be updated with the following:


  • 您可以忽略有关前端应用程序注册的部分。

  • 在Alexa帐户链接部分中,将URL更新为使用login.microsoftonline.com而不是login.windows.net

  • ClientId作为其应用程序ID 后端应用程序注册

  • 必须设置?resource = ,并且必须与该参数的受众群体参数相同JWT承载选项。如果您在Visual Studio中使用.Net Core 2.0模板,则为ClientId。

  • 不能使用的客户端密钥(密钥)不能为从不过期。使用1年或2年的持续时间。

  • You can ignore the sections about the "front end" app registration.
  • In Alexa account linking section update URLs to use login.microsoftonline.com instead of login.windows.net
  • ClientId to be the Application Id of the "back end" app registration
  • The ?resource= has to be set and has to be the same as the audience parameter for the JWT bearer options. This is ClientId if you use the .Net Core 2.0 template in Visual Studio.
  • The client secret (key) that is used can not be one that "Never Expires". Use a 1 or 2 year duration.