【问题标题】:ProcessUserAuthorization in Google OAuth2.0 is throwing 400 errorGoogle OAuth2.0 中的 ProcessUserAuthorization 抛出 400 错误
【发布时间】:2018-09-18 05:18:12
【问题描述】:

我在使用 c# 中的一行代码来发出 OAuth2.0 请求时遇到问题。代码是这样的:

            WebServerClient consumer = new WebServerClient(CGmail.serverGmail, CGmail.clientIDGmail, CGmail.clientSecretGmail);
            consumer.ClientCredentialApplicator = ClientCredentialApplicator.PostParameter(CGmail.clientSecretGmail);
            IAuthorizationState grantedAccess = null;
            try
            {
                    grantedAccess = consumer.ProcessUserAuthorization(Request);
            }
            catch (Exception ex)
            {   
            }

grantedAccess = consumer.ProcessUserAuthorization(Request); 行抛出以下错误:

直到昨天,这一切都很好,我没有对此功能进行任何更改。有谁知道会发生什么?

【问题讨论】:

    标签: c# .net oauth-2.0 google-signin


    【解决方案1】:

    我们也突然遇到了这个问题。我怀疑这与 Google 更改了他们的一些 OAuth2 endpointsdeprecating some scopes 有关。仍然不太确定是什么原因导致它特别破裂。我无法让 DotNetOpenAuth 处理范围和端点的任何更改,但我承认我不是 OAuth2 方面的专家。

    为了解决这个问题,我们只使用了Google.Apis 而不是 DotNetOpenAuth。

    【讨论】:

    • 感谢您的回答。随便我们正在实施 Google.Apis 但我们还没有完成,所以在我们实施后我会将此答案标记为正确,我们认为这是替代解决方案。
    • 那么除了使用 Google Api 之外我们没有其他选择吗?
    猜你喜欢
    • 2012-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-20
    • 1970-01-01
    • 2017-02-09
    • 2012-01-18
    • 2020-10-28
    相关资源
    最近更新 更多