Setup Azure AD External Identity Provider for SSO with ASP.NET core - asp.net-core

I know how to add external provider using .net Core Identity for Google, But i couldn't get any example to implement for Azure AD SSO using SAML2.So far i know we can use Sustainsys library to configure SAML2.
Exising code :
var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: true);
if (result.Succeeded)
{
//Redirect to Login page
}
I have tried using Sustainsys library to implement , But there is no sample code or documentationusing ASP.NET identity.

While the Sustainsys.Saml2 library can certainly be used with Azure AD, I'd recommend using the OpenID Connect packages from Microsoft that are built for Azure AD. They provide a better experience.

Related

Does Service Principal (SPN) values has to be change while doing ADAL.Net to MSAL.Net migration?

We have a Web Application in .Net Core 6.0 that we have registered in Azure AD app registration in azure portal.
We have used ADAL.net library in our code for Authentication. Now, we are migrating authentication library Adal.net to Msal.Net.
We have used below endpoints URLs to generate tokens
https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize
https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
When we migrate the application, we have to change the library references and related code in our application.
We want to confirm on the below points -
Do we need do any changes in app registration configuration in azure portal or any code level configuration changes in application related to MSAL.Net Library like in appsettings or startup.cs class?
Do we need to do any change in service principal (SPN) values?
If you are on ASP.NET Core 6.0, you should use Microsoft.Identity.Web, which provides higher-level APIs on top of MSAL.NET. See the migration guide here. You do not need to change any of your app registration when migrating, include the service principal values.

Which nuget package for OpenIdConnect authentication

I am trying to create a login mvc application in .NET through which any identity provider that supports OpenIdConnect for authentication and Oauth2.0 for authorization should be able to communicate. The objective is all my microservices will then call the login service ( which will act as a proxy) to perform single login and single logout and authorization via different identity providers such as Ping Identity or Okta or perhaps Azure AD.
Which Nuget package will be best to use in my login mvc application? Microsoft.AspNetCore.Authentication.OpenIdConnect or Microsoft.Owin.Security.OpenIdConnect. If there is any other library please shed some light. I am new in OpenIdConnect and IDP providers so please help me out here.
I would use Microsoft.AspNetCore.Authentication.OpenIdConnect for ASP.NET Core projects and Microsoft.Owin.Security.OpenIdConnect if you are using .NET Framework.

Blazor wasm hosted application with company AD windows authentication

I am trying to figure out how can I call blazor wasm hosted application to my company's AD directory and get user.identity information.i am just running in circles.i don't want to use identity server or azure Ad.can someone please share code. The actual working code. Company policy is not allowing to use sticky sessions so can't use blazor server. Please any help.much appreciated.code would be much appreciated. I am surprised there is no such code out there. I am using .net 5
You'll really struggle to get this to work - from MS website:
We don't recommend using Windows Authentication with Blazor Webassembly or with any other SPA framework. We recommend using token-based protocols instead of Windows Authentication, such as OIDC with Active Directory Federation Services (ADFS).
Reference: https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/?view=aspnetcore-5.0#windows-authentication
I highly suggest switching to an OIDC implementation instead. ADFS supports this and your company might already have this setup on the network.

Visual Studio 2015 Azure AD and ADFS authentication to Web Server hosted web app

I have a MVC web application hosted in IIS and users are stored in Azure AD.
I need to authenticate Azure AD users to access web application.
I am using ADFS for this and installation has been done on Azure.
To authenticate I need to know whether I should go for Window Identity Foundation or OWIN?
In many articles i read WIF has been deprecated and Using OWIN.
Let me know if owin is proper way for my scenario and if some proper examples are available?
Latest version of WIF is 4.5 which is also not available for VS2015
I understood is WS-FED is using SAML Token for this?
Confusion - your MVC application authenticates using Azure AD. Where does ADFS fit in? Have you got a federated tenant?
WIF is still around - people still use it. In VS2015, WIF is built in to .NET. So you can use it.
Yes - WIF (WS-Fed) uses a SAML token.
With OWIN you have a choice - you can use WS-Fed or OpenID Connect (OIDC) or even both.
Unless you are using ADFS 4.0, you need WIF as there is no support for OIDC in the earlier versions.

Why Authentication type - individual user accounts for Web API in .NET Core is not available when we creating new Web APi service

Why it`s not possible to create Web API project with Individual User Accounts Authorization type?
UPDATE:
All version numbers are updated from v1.2 to v2.0.
Please find the ASP.NET Core Schedule and Roadmap:
Identity Application Services
A service layer will be added ASP.NET Core Identity and included in the project templates using Individual Authentication. This will allow authentication of users by way of JWT tokens such that Web APIs can be secured out of the box, and make it simpler to change authentication systems, e.g. from in-app Identity to Azure AD B2C, or 3rd-party solutions like Identity Server.
Daniel Roth from MS:
Support for individual user accounts with the Web API template in VS is not available yet. We are still looking at providing a supported on premise offering for token issuance in addition to providing integration with Azure AD B2C.
This statement can be found in the comment section under https://channel9.msdn.com/Events/dotnetConf/2016/Building-Secure-Web-APIs-with-ASPNET-Core
This is just disabled in core 1.1.please use core 2.0 to find all authentication.You can download core 2.0 from
here