- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我第一次尝试使用外部提供者登录时返回 null 然后我在提供者中再次按下,一切都很好。我认为是 cookie 的问题,因为当我删除所有 cookie 并重试时会发生错误。
如果我删除所有 Session 和 TempData 一切正常,这是为什么?
public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
{
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
if (loginInfo == null)
{
Elmah.ErrorSignal.FromCurrentContext().Raise(new NotImplementedException("Error ExternalLoginCallback"));
TempData["_Error"] = "El incio de sesión con redes sociales no está disponible en este moemento, intente con su usuario y clave";
return RedirectToAction("Login");
}
}
最佳答案
我必须创建一个过滤器并放入以下内容
public class FilterBase : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
if (!filterContext.IsChildAction && !filterContext.HttpContext.Request.IsAjaxRequest())
{
/*
* MICROSOFT BUG
* http://stackoverflow.com/questions/20737578/asp-net-sessionid-owin-cookies-do-not-send-to-browser/21234614#21234614
* https://katanaproject.codeplex.com/workitem/197
*/
filterContext.HttpContext.Session["Workaround"] = 0;
}
}
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
}
}
关于c# - 等待 AuthenticationManager.GetExternalLoginInfoAsync() 返回 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21654277/
我有访问 AuthenticationManager 的私有(private)属性: private IAuthenticationManager AuthenticationManager => H
ExternalLoginInfo loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(); 为什么这一行必须总是返回
我创建了一个新的 MVC5 Web 应用程序,当我按照官方指南尝试使用 Google 登录时 http://www.asp.net/mvc/overview/security/create-an-as
我结合使用 IdentityServer4 和 ASP .NET Core Identity 来创建联合登录页面。我正在使用的外部提供商之一是通过 Open ID Connect 协议(protoco
当我第一次尝试使用外部提供者登录时返回 null 然后我在提供者中再次按下,一切都很好。我认为是 cookie 的问题,因为当我删除所有 cookie 并重试时会发生错误。 如果我删除所有 Sessi
任何人都可以帮助阐明 Live SDK (v5.6) 的实现与 Microsoft.AspNet.Identity.Owin.dll 中发生的事情吗? 通过以下方式验证成功后返回的用户id: //MV
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(); if (loginInfo == null) {
我一直在尝试使用 Google 帐户在 MVC5 应用程序中使用 OWIN 实现外部登录。 如果我已经登录到 google,单击我的应用程序中的 google 按钮就可以了,它会在允许我访问登录信息后
我创建了一个新的 MVC5 Web 应用程序,当我尝试使用 Google 或 Facebook 登录时,调用了 AccountController 中的 ExternalLoginCallback 操
我使用 Strava 作为我的外部登录提供商(我假设这与 Strava 无关,也可能是 google 或 facebook)运行几个小时/天甚至几周后 GetExternalLoginInfoAsyn
更新我的 MVC5 应用程序的 nuget 包后(到目前为止一直正常工作)用于验证我的用户 Facebook 登录的身份验证管理器现在总是返回 null。 我正在 visual studio 2012
我有 ASP.NET 5 项目,我正在使用 Web API 建立外部登录(用于 Facebook 和 Google)。就我而言,我有包含以下代码的 Web API Controller (不是 MVC
OWIN 身份验证有问题。当我尝试使用 Facebook 或 Google 登录时,我总是从 GetExternalLoginInfoAsync() 收到空值。 但是有一些神秘的情况。当我打开 Fid
我正在尝试在 Visual Studio 2013 的新 MVC 5 项目中设置集成的 OWIN WS-Federation (ADFS) 身份验证。 Startup.Auth 中的 WsFedera
我正在尝试使用 dot-net core 2.0 设置 Facebook 身份验证,但在我的ExternalLoginCallbackAsync 方法中,我总是得到 null 作为响应,我已遵循文档,
这个问题已经有答案了: ASP.NET_SessionId + OWIN Cookies do not send to browser (9 个回答) 已关闭5 个月前。 我使用默认的 Visual
我可以使用 this library 在 .NET Core 1 中配置 Instagram 身份验证,但我似乎无法让它在 .NET Core 2 中工作。 似乎没有任何与 .NET Core 2.0
我已经尝试了几乎所有可用的在线解决方案,但仍然无法获得有效的解决方案。我使用 GoogleAuthentication 使用 dotnetcore 3 web API 进行 POC。 我已将 cons
为什么 signinmanager getexternallogininfoasync 方法总是返回 null? 我将 VS2015 与默认的 asp.net 核心(不是框架)项目一起用于具有个人用户
我正在将 SustainSys.Saml2 与 Gluu 服务器集成为我的 IdP。我正在使用开箱即用的脚手架身份页面。当我在 localhost 中运行并查看控制台日志时,一切似乎都可以与 SAML
我是一名优秀的程序员,十分优秀!