ASP.NET Core 2上的SustainSys.Saml2-GetExternalLoginInfoAsync()返回null

问题描述 投票:6回答:1

我正在将SustainSys.Saml2与Gluu服务器作为我的IdP集成。我使用的是现成的支架式身份页面。当我在localhost中运行时,并且查看控制台日志时,一切似乎都可以与SAML通信一起使用,甚至看到几行显示为:

Sustainsys.Saml2.AspNetCore2.Saml2Handler[0]
Successfully processed SAML response Microsoft.IdentityModel.Tokens.Saml2.Saml2Id and authenticated
Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler[10]
AuthenticationScheme: Identity.External signed in.

除非我没有记错,否则表明在SAML方面一切都很好。但是我不明白的是为什么在ExternalLogin.OnGetCallbackAsync中,命令

var info = await _signInManager.GetExternalLoginInfoAsync();

info设置为null

为了进行记录,在Startup.cs中,我有:

services.AddAuthentication()
  .AddSaml2(options =>
  {
    options.SPOptions.EntityId = new EntityId("{entityId}");
    options.IdentityProviders.Add(
      new IdentityProvider(new EntityId("{entityId}"), options.SPOptions)
      {
        Metadatalocation = "{metadataURL}",
      });
    options.Validate();
  });
asp.net-core-2.0 sustainsys-saml2 gluu
1个回答
0
投票

我能够根据this GitHub issue和其中的Anders注释来解决这个问题。

我将在此处链接到我的评论。阅读上面的安德斯评论以获取解释。 https://github.com/Sustainsys/Saml2/issues/1030#issuecomment-616842796

© www.soinside.com 2019 - 2024. All rights reserved.