【发布时间】:2016-10-07 17:40:23
【问题描述】:
我在 Azure 网站上发布了我的 MVC .NET 项目。
问题是当我创建UserCredential 时,我得到一个Exception,上面写着“访问被拒绝”:
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets { ClientId = clientId, ClientSecret = clientSecret }
, scopes
, userName
, CancellationToken.None
, new DataStore()).Result;
我的 GoogleAPIs 控制台凭据如下所示 (Client Secret):
然后,在我的 Azure 门户中,我配置了 Authentication/Authorization:
我确定问题是 凭据问题,因为当我在 localhost 中尝试它时,它可以正常工作。当它使用完全相同的凭据部署在 azure 中时,问题就出现了。
- 我是否遗漏了任何一步?
- 我的 Google 凭据有问题吗?
- 我是否应该在 Azure 中启用其他功能?
【问题讨论】:
标签: azure oauth google-api google-drive-api azure-web-app-service