【问题标题】:Error 404 - connect to Gmail API from MVC Application错误 404 - 从 MVC 应用程序连接到 Gmail API
【发布时间】:2015-07-17 18:34:10
【问题描述】:

我有问题。我尝试从我的 MVC 应用程序连接 Gmail API。在我的本地机器上一切正常,但是当我将应用程序部署到 IIS 时出现 404 错误。这是由于正确为“http://localhost/myApplicationName/AuthCallback/IndexAsync”时将应用程序重定向到“http://localhost/AuthCallback/IndexAsync”地址引起的。

我可以更改默认重定向网址吗?

用户授权后出现错误。

我正在使用 Google.Apis 版本 1.9.1.12395 和 GoogleApis.Gmail.v1 版本 1.9.0.31。

【问题讨论】:

  • 欢迎来到 Stack Overflow Mariusz!您是否尝试过在 Google Developer Console 中更改应用程序的重定向 URL? console.developers.google.com
  • 嗨,是的,我这样做了。谢谢你的回答。

标签: gmail-api


【解决方案1】:

好的,我解决了问题。我必须覆盖类 AppFlowMetadata

中的参数
public override string AuthCallback
{
get
    {
        return @"/ApplicationName/AuthCallback/IndexAsync";
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-07
    • 1970-01-01
    • 2016-08-30
    • 2015-07-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-06
    相关资源
    最近更新 更多