I am new to SAML and .NET core 2.0 cookie authentication. I am trying to implement SAML 2.0 compliance in a .NET core 2.0 using Okta as an IdP. I have read through a lot of .NET core documentation around authentication but there is no authentication scheme for a federated IdP using the SAML 2.0 flow wherein the IdP calls back the SP with a SAML once it is done authenticating the user.
The flow is as follows
Client (calls SP for accessing data) => SP
SP (redirects client to IdP) -> Client => IdP
IdP(authenticates user and calls the callback URL for SP) => SP
SP (serves content to client with cookie for future requests) => Client
Client (requests another resource + appends cookie) => SP
SP (validates cookie [ login again if invalid | continue if valid ] and serves content) => Client
I also tried reading through ASP .NET Core code samples for Cookies but it implements a method HttpContext.Authentication.SignInAsync
that has been marked as obsolete by Microsoft.
While working on this I tried to use the using Microsoft.IdentityModel.Tokens.Saml2
nuget package for parsing Saml2 but without an authentication scheme I could not get far in my custom implementation.
Any code samples or libraries that I can use to implement this flow will be helpful.