- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
设置:
使用 js 库并遵循我的 C# Xamarin 项目的客户端登录/身份验证流程。
CORS 已设置并且初始登录正常:
this.client = new WindowsAzure.MobileServiceClient(<endpoint>);
this.client.login(<provider>);
我存储返回的“userId”和“mobileServiceAuthenticationToken”以供将来使用。
问题:
调用azure-mobile-apps-client的invokeApi:
this.client.invokeApi("myCustomerController", { method: 'GET' })
返回:
401 (Unauthorized)
我错过了什么吗?我希望客户端准备好调用我的后端服务。
我尝试过登录后直接使用现有客户端,但没有成功。
设置新客户端的“userId”和“mobileServiceAuthentication token”时也会失败。
当从其他地方(例如 C# MobileServiceClient)调用时,我调用的自定义 ApiController 工作正常。
最佳答案
我认为登录将使客户端准备好使用,但在我的情况下并非如此。我必须调用登录,获取结果中返回的 userId 和 token ,然后在发出任何 future 请求之前手动设置 currentUser。
this.client = new WindowsAzure.MobileServiceClient("https://...");
this.client.currentUser = {
userId: "xxxxx",
mobileServiceAuthenticationToken: "xxxxx"}
关于azure-mobile-apps-client - invokeApi 未经授权,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38943371/
我正在使用 Android Azure 移动服务 SDK 连接到 Azure 移动服务。当我使用 MobileServiceClient 的 invokeApi 时,当 Api 在 60 秒内完成时一
有人知道如何使用 Xamarin 组件的 MobileServices SDK 从 Xamarin 客户端调用 Windows Azure 移动服务中的自定义 API 吗? MobileService
我正在将我的 Angular 应用程序与 Azure 服务后端集成。 我最初只是使用标准的 $http 调用,如下所示: $http({ method: 'POST',
设置: 使用 js 库并遵循我的 C# Xamarin 项目的客户端登录/身份验证流程。 CORS 已设置并且初始登录正常: this.client = new WindowsAzure.Mobile
我想从 Azure 移动服务中的自定义 API 获取客户搜索结果。当我使用 Fiddler 检查客户 API 时,它返回多个搜索结果。但我的 Invoke API 只得到一个结果。我怎样才能得到所有结
我正在尝试一些非常简单的事情。我有一个名为“missingvehiclesfrominventoryjob”的自定义 API,它只是从标准 SQL 查询返回记录集。 我可以在 WinForms 和 W
我是一名优秀的程序员,十分优秀!