Hi Akanksha,
We support two approaches for adding SAML SSO support to your application. The first is to call the SAML API from your application. Alternatively, you can add the SAML middleware to handle SSO rather than calling the SAML API. Calling the SAML API provides you with a little more control. Using the SAML middleware means a little less code has to be written.
The ExampleServiceProvider and MiddlewareServiceProvider projects under the Examples\SSO folder demonstrate the two approaches.
Please refer to these projects for code examples. Also, the Examples Guide in the documentation folder walks you through these examples.
Briefly though, here's an example of the start-up code when using the API approach.
// Add SAML SSO services.
services.AddSaml(Configuration.GetSection("SAML"));
And here's an example of the start-up code when using the middleware approach.
// Add SAML SSO services.
services.AddSaml(Configuration.GetSection("SAML"));
// Add SAML authentication services.
services.AddAuthentication().AddSaml(options =>
{
options.PartnerName = (httpContext) => Configuration["PartnerName"];
});
Which cookie are you referring to? Do you mean the authentication cookie?
Assuming so, please refer to:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.cookies.cookieauthenticationoptions?view=aspnetcore-6.0