Search Results :
×ASP.NET Core SAML Single Sign-On (SSO) middleware gives the ability to enable SAML Single Sign-On for your ASP.NET core applications. Using Single Sign-On you can use only one password to access your ASP.NET core application and services. Our middleware is compatible with all the SAML compliant Identity providers. Here we will go through a step-by-step guide to configure Single Sign-On (SSO) between ASP.NET Core and ADFS considering ADFS as IdP. To know more about the features we provide for ASP.NET Core SSO, click here.
Note: To integrate the miniOrange ASP.NET SAML SSO middleware in your application, you will be required to add the below namespaces, services and middleware in your project (marked in green), below here is a sample example
using miniOrange.saml; using System.Reflection; public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration {get;} // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); services.AddminiOrangeServices(Assembly.GetExecutingAssembly()); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseCookiePolicy(); app.UseAuthentication(); app.UseStaticFiles(); app.UseminiOrangeSAMLSSOMiddleware(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); }); } }
using miniOrange.saml; using System.Reflection; var builder=WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddRazorPages(); builder.Services.AddminiOrangeServices(Assembly.GetExecutingAssembly()); 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://<asp-net-middleware-base-url>/?ssoaction=config
There are two ways detailed below with which you can get the SAML SP metadata to configure onto your identity provider end.
Note: In the next step enter the desired Display Name and click Next.
Note: In the next step enter the desired Display Name and click Next.
Follow the steps below to configure Windows SSO
setspn -a HTTP/##ADFS Server FQDN## ##Domain Service Account##
FQDN is Fully Qualified Domain Name (Example : adfs4.example.com)
Domain Service Account is the username of the account in AD.
Example : setspn -a HTTP/adfs.example.com username/domain
Set-AdfsProperties -WIASupportedUserAgents ((Get-ADFSProperties | Select -ExpandProperty WIASupportedUserAgents) + "Chrome")
Get-AdfsProperties | Select -ExpandProperty WIASupportedUserAgents;
There are two ways detailed below with which you can configure your SAML identity provider metadata in the middleware.
string name=""; string claimtype=""; string claimvalue=""; if(User.Identity.IsAuthenticated) { foreach( var claim in User.Claims) { claimtype = claim.Type; claimvalue = claim.Value; } //retrive custom attributes(for eg. Retrieve Mapped 'mobileNumber' attribute of your IDP) var identity = (ClaimsIdentity)User.Identity; IEnumerable claims = identity.Claims; string mobileNumber = identity.FindFirst("mobileNumber")?.Value; }
https://asp-net-middleware-base-url/?ssoaction=login
<a href=”https://asp-net-middleware-base-url/?ssoaction=login”>Log
in</a>
https://asp-net-middleware-base-url/?ssoaction=logout
<a href=”https://asp-net-middleware-base-url/?ssoaction=logout”>Log
out</a>
To configure your IDP, you can find the service provider's metadata in appsetting.json file. For SP metadata, you can refer to the screenshot below:
From miniOrange section, copy spentityid, acsurl and provide it to your identity provider's team.
idp_cert | Enter the IDP certificate against this field |
ssourl | Enter the SSO URL against this field |
idp_issuer | Enter the IDP Issuer against this field |
string name="";
string claimtype="";
string claimvalue="";
if(User.Identity.IsAuthenticated) {
name= User.Identity.Name;
foreach( var claim in User.Claims) {
claimtype = claim.Type;
claimValue = claim.Value;
}
}
You can configure the ASP.NET Core SAML 2.0 Single Sign-On (SSO) middleware with any Identity Provider such as ADFS, Azure AD, Bitium, centrify, G Suite, JBoss Keycloak, Okta, OneLogin, Salesforce, AWS Cognito, OpenAM, Oracle, PingFederate, PingOne, RSA SecureID, Shibboleth-2, Shibboleth-3, SimpleSAML, WSO2 or even with your own custom identity provider. Check the list of identity providers here.
Not able to find your identity provider? Mail us on aspnetsupport@xecurify.com and we'll help you set up SSO with your IDP 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.