- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
ExternalLoginInfo loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
为什么这一行必须总是返回 null?当用户尝试使用任何提供商登录时,就会发生这种情况。我知道 FLOW 是正确的,因为它实际上在本地工作,但是当我部署网站时它总是返回 null。
据我了解,它使用外部 cookie 来跟踪此信息,我可以确定它不是浏览器,因为它在同一浏览器上本地运行。
所有供应商都会出现这种情况,尽管我已经仔细检查过所有供应商都在各自的控制面板中将域设为“允许”。就像我说的一切都在本地工作。
我已经按照一些答案的建议尝试重新启动 IIS。
在 Startup.Auth.cs 中也有这些行,并且正确设置了 cookie domian
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
CookieDomain = ".example.com",
...
});
//use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
最佳答案
确保您的(facebook、twitter 等)提供商设置在部署时未被覆盖。
还要确保您的回调 URL 已在提供商处正确注册。我正在使用 LinkedIn,它需要一个完整的 url 到你的回调,例如。 https://domain.com/signin-linkedin
我有以下设置,可以正常工作:
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
CookieSecure = CookieSecureOption.SameAsRequest,
CookieName = "CustomCookieName",
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, User>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => Some.Custom.Identity.Helper.GenerateUserIdentityHelperAsync(user, manager)) // This helper method returns ClaimsIdentity for the user
}
});
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
关于c# - AuthenticationManager.GetExternalLoginInfoAsync() 始终为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30771739/
我正在尝试使用 AuthenticationManager 类 SignIn() 中的方法; 这是我的做法: AuthenticationManager.SignIn(identity); 但是它说那
AuthenticationManager 有两种方法。 void SignIn(params ClaimsIdentity[] identities); Task AuthenticateAsync
我有以下类(class): @Configuration @EnableAuthorizationServer public class AuthServerConfig extends Author
有没有办法告诉 Spring 在我制作的自定义用户 bean 中找到用户的角色? http://static.springsource.org/sprin...ns-config.html 因此,如果
关注 this问题,缺少方法的引用文献 SignOut()和 SignIn() : private async Task SignInAsync(User user, bool isPersisten
我正在尝试实现以下内容,但我的authenticationManager实例抛出以下异常并且未 Autowiring 。如何从 Spring 手动获取它的实例?我没有使用 Spring Control
我正在尝试在一个简单的应用程序中实现基于 spring security 的完全自定义登录,这将作为我更复杂项目的基础。目前,我需要编写一个自定义的 AuthenticationManager。 在
ExternalLoginInfo loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(); 为什么这一行必须总是返回
我在调用 authenticationManger.authenticate() 时收到 StackOverflowError java.lang.StackOverflowError: null a
我正在使用 Spring Boot 2.0(利用 Spring Security 5.0)。我正在尝试向 WebSecurityConfigurerAdapter 子类中的 Authenticatio
我可以从数据库中获取有效用户,创建 ClaimsIdentity 并调用 SignIn 方法,不会出现错误。 public ActionResult SignInConformation(SignIn
我需要访问 Controller 外部的 AuthenticationManager 的有效实例。例如,在自定义 AuthroizeAttribute 中。在用于创建使用 ASP.NET Identi
今天早上,我使用 Spring-Security JWT 实现了自己的登录 Controller ,并且运行良好。 现在我在不更改代码的情况下尝试了相同的操作(这就是 git 存储库所说的),并且当
对于BasicAuthenticationFilter,我正在尝试注入(inject)我自己的AuthenticationManager。但是当我调试 Startup 时,我总是发现类 BasicAu
这个问题在这里已经有了答案: 关闭9年前。 Possible Duplicate: Getting error org.springframework.beans.factory.NoSuchBean
谁能告诉我 Spring Security 中 AuthenticationManager 和 AuthenticationProvider 之间的区别? 如何使用它们以及如何调用它们。我的理解是 S
我正在处理 .Net Core 项目,现在我需要 AuthenticationManager 接口(interface)IAuthenticationManager 根据微软this已经过时了。 要获
我们希望针对 SharePoint Online 对我们的 .net core 控制台应用程序进行身份验证 >> 但似乎有两种方法可以使用 PnP.Framework.AuthenticationMa
这个问题已经有答案了: Why is my Spring @Autowired field null? (21 个回答) 已关闭 9 年前。 我正在构建一个 REST 端点来验证(登录)用户。我为此使
当我第一次尝试使用外部提供者登录时返回 null 然后我在提供者中再次按下,一切都很好。我认为是 cookie 的问题,因为当我删除所有 cookie 并重试时会发生错误。 如果我删除所有 Sessi
我是一名优秀的程序员,十分优秀!