azure - 访问/.auth/refresh权限错误

标签 azure authentication xamarin.forms azure-mobile-services

我正在使用 Azure 应用服务,并使用 Google 和 Microsoft 帐户进行身份验证。 我可以访问 mysite/.auth/me,登录时没有任何问题。 但要刷新 token ,/.auth/refresh 会在出现异常后返回给我。

You do not have permission to view this directory or page.

不确定在 Azure Blade 中授予什么访问权限。

最佳答案

该错误消息实际上有点误导。这并不是说您没有访问 API 的权限,而是您的 token 存储中可能没有刷新 token 。每个提供商在用户登录期间获取刷新 token 的方式略有不同。更多详细信息请参见:

https://cgillum.tech/2016/03/07/app-service-token-store/

In order for this to work, the token store must contain refresh tokens for your provider. If you’re not familiar with how to do this, here are some hints:

  • Google: Append an "access_type=offline" query string parameter to your /.auth/login API call (if using the Mobile Apps SDK, you can add this to one of the LogicAsync overloads).
  • Microsoft Account: Select the wl.offline_access scope in the Azure management portal.
  • Azure AD: This is a little complex right now, but take a look at my next post on enabling Graph API access. Follow the setup steps and this will also enable you to get refresh tokens for Azure AD (you can omit the Read directory data and the resource=… parts if they don’t apply to you). The plan is to simplify this in the future.

关于azure - 访问/.auth/refresh权限错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38747136/

相关文章:

xaml - 如何使用xamarin表单在 ListView 中添加复选框

azure - 应用最新的运行时更新来改进 QnA Maker 结果 - 需要重新迁移吗?

authentication - 在 Drupal 中注册后重定向

c# - Xamarin.Forms DependencyService Get() 方法在 PCL 中返回 Null

php - 类 App\Http\Controllers\ManagerLoginController 不存在

asp.net-mvc - 如何将 MVC 5 IdentityModels.cs 移动到单独的程序集中

c# - "Can' t 在 Xamarin Forms 项目中找到“NS*Types(例如 NSFileManager 或 NSUrl)

c# - Azure 文件挂载到云服务

azure - 在 Azure Devops 上的 cURL 请求中使用环境变量

c# - 仅使用 Azure AD 进行身份验证而不是授权