0

我正在尝试将外部登录提供程序添加到 SPA 应用程序,但我一直收到这条奇怪的消息:错误:invalid_request

我提出的要求:

  using (Html.BeginForm("ExternalLogin", "api/Account", new { ReturnUrl = "/" },FormMethod.Get))
    {
        @Html.AntiForgeryToken()
        <div id="socialLoginList">
            <p>
            @foreach (AuthenticationDescription p in loginProviders)
            {
                <button type="submit" class="btn btn-default" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="Log in using your @p.Caption account">@p.AuthenticationType</button>
            }
            </p>
        </div>
    }

我试图将 ReturnUrl 修改为 /api/Account/ExternalLogins 但它不起作用。我找不到一个很好的 Owin 实现示例来解释它应该如何工作。

4

1 回答 1

0

您是否确定已在第三方应用中注册了返回 URL?当我没有在 Google 开发者控制台中添加允许的返回 URL 时,我明白了。

于 2015-03-06T05:26:39.543 回答