Hi,
I have a requirement to add SSO SAML2 support to my Aspnet Zero application. I am running the MVC5 version.
I have decided to go with the Api provided by Sustainsys.Saml2 (formerly Kentor).
I have imported the library and set it up to run via the OWIN pipeline. This is easily done with the following line of code in StartUp:
app.UseSaml2Authentication(new Saml2AuthenticationOptions(true));
The return URL is set to AccountController.ExternalLoginCallback. I have the following code:
// returns null
var loginInfo = await _authenticationManager.GetExternalLoginInfoAsync();
if (User.Identity.IsAuthenticated)
{
// returns valid claims
var claims = ClaimsPrincipal.Current.Claims;
}
What I am finding is that the authentication succeeds. I am getting a user identity and claims are coming across from the Identity Provider.
The problem is that the call to GetExternalLoginInfoAsync returns NULL, and I am therefore unable to sign the user in.
I am assuming that further work is required in plumbing the authenticated user into the pipeline. Please could you provide some assistance as to how I can proceed.
Many thanks.
3 Answer(s)
-
0
Can you check that https://entityframeworkcore.com/knowledge-base/55757059/aspnet-core-identity-getexternallogininfoasync-always-null
-
0
Hi,
Just a question about your implementation. Can you reccomend any guides on how to implement this?
-
0
Hi,
You can take a look at https://aspnetboilerplate.com/Pages/Documents/Zero/User-Management#external-authentication for implementing a new external authentication.