问题描述
我玩与Azure的移动应用后端(的NodeJS),作为讨论的此处。我一直在使用默认的网络设置配置来开发自己的移动应用程序,但现在我想定制的云后端功能,所以我创建了在Azure-Mobile的应用SDK当地后端。
I am playing with an Azure Mobile Apps backend (nodeJS), as discussed here. I have been using the default web setup configuration to develop my mobile app, but now I want to customise the cloud backend functionality, so I have created a local backend with the Azure-Mobile-Apps SDK.
我登录我的移动应用程序(使用Azure的客户端SDK授权方面),然后攻占的authToken,采用了现场管理的后端设置。
I logged in with my mobile app (using the authorization aspect of the Azure client SDK) and then captured the AuthToken, using a live managed backend setup.
当我再来找尝试和授权的请求,我得到了以下问题:
When I then come to try and authorise a request, I get the following issue:
{名:JsonWebTokenError,消息:智威汤逊的观众预计无效:金塔:微软:Windows的蔚蓝:谟}
这是继:Locally测试Azure的移动验证 - 无效的智威汤逊的签名
如何能我设置了智威汤逊的观众呢?
How can I set the jwt audience?
推荐答案
要设置了观众和发行人,使用AUTH:{}对象在azureMobile.js。您可以在jwt.io去code中的智威汤逊,看看观众和发行人一样,那么这样做:
To set the audience and issuer, use the auth:{} object in your azureMobile.js. You can decode the JWT at jwt.io to see what the audience and issuer are, then do:
auth: {
audience: '<your audience>',
issuer: '<your issuer>'
};
有一些很好的参考:
- (这azureMobile。 JS出口)
- My blog post on Custom Auth
- The main configuration reference (which azureMobile.js exports)
这篇关于智威汤逊的设置观众Azure的移动应用后端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!