#StackBounty: #asp.net-core-2.0 #sustainsys-saml2 #gluu SustainSys.Saml2 on ASP.NET Core 2 – GetExternalLoginInfoAsync() returns null

Bounty: 50

I’m integrating SustainSys.Saml2, with Gluu server as my IdP. I’m using the scaffolded Identity pages out of the box. When I run in localhost, and I view the console log everything seems to work with the SAML communication, and I even see a couple lines that read:

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.

Unless I’m mistaken, that indicates everything’s good on the SAML end of things. But what I don’t then understand is why, in ExternalLogin.OnGetCallbackAsync, the command

var info = await _signInManager.GetExternalLoginInfoAsync();

finds info set to null.

For the record, in Startup.cs, I have:

services.AddAuthentication()
  .AddSaml2(options =>
  {
    options.SPOptions.EntityId = new EntityId("{entityId}");
    options.IdentityProviders.Add(
      new IdentityProvider(new EntityId("{entityId}"), options.SPOptions)
      {
        Metadatalocation = "{metadataURL}",
      });
    options.Validate();
  });


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.