我正在尝试将外部登录提供程序添加到 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 实现示例来解释它应该如何工作。