@@ -49,7 +49,7 @@ User is sent back to your app - you need to validate the SAML response ("asserti
4949Here's an example of how you do it in ASP.NET Core MVC
5050
5151``` c#
52- // ASP.NET Core MVC action method... But you can easily modify the code for old .NET Framework, Web-forms etc.
52+ // ASP.NET Core MVC action method... But you can easily modify the code for old .NET Framework, minimal API etc.
5353public async Task < IActionResult > SamlConsume ()
5454{
5555 // 1. TODO: specify the certificate that your SAML provider gave you
@@ -66,18 +66,19 @@ BLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAH123543==
6666 // WOOHOO!!! the user is logged in
6767 var username = samlResponse .GetNameID (); // let's get the username
6868
69- // the user has been authenticated
70- // now call context.SignInAsync() for ASP.NET Core
69+ // the user has been authenticated, now what?
70+ // we can call context.SignInAsync() for ASP.NET Core
7171 // or call FormsAuthentication.SetAuthCookie() for .NET Framework
7272 // or do something else, like set a cookie or something...
7373
74- // FOR EXAMPLE this is how you sign-in a user in ASP.NET Core 3,5,6,7
74+ // FOR EXAMPLE this is how you sign-in a user in ASP.NET Core 3,5,6,7,8
7575 await context .SignInAsync (new ClaimsPrincipal (
7676 new ClaimsIdentity (
7777 new [] { new Claim (ClaimTypes .Name , username ) },
7878 CookieAuthenticationDefaults .AuthenticationScheme )));
79+ // Yeah, it's a mouthful, sorry, not my fault
7980
80- return Redirect (" ~/" );
81+ return Redirect (" ~/" ); // redirect authenticated user back to homapage for example
8182 }
8283
8384 return Content (" Unauthorized" );
0 commit comments