Search Results :
×ASP.NET Core as SAML identity provider provides a ready-to-use solution for SAML 2.0 login using ASP.NET credentials. ASP.NET Core SAML IdP acts as a SAML 2.0 identity provider which can be configured to establish the trust between the ASP.NET Core application and various SAML 2.0 supported service providers such as WordPress,Tableau, Moodle and many more to securely authenticate the users using the ASP.NET Core application credentials.
Not able to find your IdP? Contact us at aspnetsupport@xecurify.com and we will help you setup ASP.NET Core SSO with your SP in no time.
Reach out to us at aspnetsupport@xecurify.com and we will help you setup Blazor SAML SSO with your identity provider (IdP) in no time.
using Microsoft.AspNetCore.Authentication.Cookies; using miniOrange.saml; var builder = WebApplication.CreateBuilder(args); builder.Services.AddRazorPages(); // Add authentication services builder.Services.AddControllersWithViews(); builder.Services.AddAuthentication(options => { options.DefaultAuthenticateScheme = "SSO_OR_Admin"; options.DefaultScheme = "SSO_OR_Admin"; options.DefaultChallengeScheme = "SSO_OR_Admin"; }) .AddCookie("moAdmin", options => { }) .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options => { // Configure cookie options as needed for SSO Users }) .AddPolicyScheme("SSO_OR_Admin", "SSO_OR_Admin", options => { // runs on each request options.ForwardDefaultSelector = context => { // filter by auth type, here if the moAdmin cookie is coming in any request the Admin Authentication will work foreach (var cookie in context.Request.Cookies) { if (cookie.Key.Contains(".AspNetCore.Cookies")) { return CookieAuthenticationDefaults.AuthenticationScheme; } } // otherwise always check for cookie auth return "moAdmin"; }; }); var app = builder.Build(); if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.MapRazorPages(); app.UseCookiePolicy(); app.UseAuthentication(); app.UseStaticFiles(); app.UseminiOrangeSAMLSSOMiddleware(); app.Run();
https://<your-application-base-url>/?ssoaction=config
Note: After installation of the plugin, we need to setup the trust between your ASP.NET Core application and your service provider. SAML metadata is shared with identity provider so they can update their inbuilt configuration to support SAML Single Sign-On.
There are two ways detailed below with which you can configure your ASP.NET Core SAML identity provider metadata in the middleware.
To send the details from ASP.NET Core application to your service provider in the form of SAML tokens first, we will be required to set the authenticated user details in user claims.
var UserClaims = new List<claim>() { new Claim(ClaimTypes.NameIdentifier, "test.user@gmail.com") }; // Add your additional Claims UserClaims.Add(new Claim("email", "test.user@xecurify.com")); UserClaims.Add(new Claim("firstname", "test")); UserClaims.Add(new Claim("lastname", "user")); UserClaims.Add(new Claim("PhoneNumber", "9876543210")); // Set the User Identity with your User Claims and set your Authentication Scheme var identity = new ClaimsIdentity(UserClaims, CookieAuthenticationDefaults.AuthenticationScheme); var principal = new ClaimsPrincipal(identity); await httpContextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, principal);
<a href="https://<your-application-base-url>/?ssoaction=idpinitiatedsso"
<a
href=”https://<your-application-base-url>/?ssoaction=idpinitiatedsso”>Login</a>
Not able to find your service provider? Mail us on aspnetsupport@xecurify.com and we'll help you set up SSO with your SP and for quick guidance (via email/meeting) on your requirement and our team will help you to select the best suitable solution/plan as per your requirement.
Need Help? We are right here!
Thanks for your inquiry.
If you dont hear from us within 24 hours, please feel free to send a follow up email to info@xecurify.com
This privacy statement applies to miniorange websites describing how we handle the personal information. When you visit any website, it may store or retrieve the information on your browser, mostly in the form of the cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not directly identify you, but it can give you a more personalized web experience. Click on the category headings to check how we handle the cookies. For the privacy statement of our solutions you can refer to the privacy policy.
Necessary cookies help make a website fully usable by enabling the basic functions like site navigation, logging in, filling forms, etc. The cookies used for the functionality do not store any personal identifiable information. However, some parts of the website will not work properly without the cookies.
These cookies only collect aggregated information about the traffic of the website including - visitors, sources, page clicks and views, etc. This allows us to know more about our most and least popular pages along with users' interaction on the actionable elements and hence letting us improve the performance of our website as well as our services.