How to configure MS SSO for 3 different organizations for custom asp.net mvc 5 application

Darshan 40 Reputation points
2024-07-30T05:40:05.77+00:00

Hello,

I am trying to configure MS SSO for 3 different organizations in a custom asp.net mvc 5 application. Currently, the application uses username and password-based login, but some organizations require SSO.

Can someone provide guidance on how to configure SSO for 3 different organizations in the same asp.net mvc application using Azure AD?

Thank you.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,132 questions
0 comments No comments
{count} votes

Accepted answer
  1. Raja Pothuraju 8,075 Reputation points Microsoft Vendor
    2024-08-01T07:52:01.2933333+00:00

    Hello @Darshan,

    Thank you for posting your query on Microsoft Q&A.

    Configuring Single Sign-On (SSO) for multiple organizations using Microsoft Entra ID (Formerly named as Azure AD) in an ASP.NET MVC 5 application involves several steps. Below is a high-level guide to help you set this up:

    Steps to Configure:

    1. Register Your Application in Entra ID

    You need to register your application in each Entra ID tenant.

    1. Register the Application in Azure AD:
      • Go to the Azure portal.
      • Navigate to Microsoft Entra ID > App registrations.
      • Click on New registration.
      • Fill in the required details (Name, Redirect URI, etc.).
      • Note down the Application (client) ID and Directory (tenant) ID.
    2. Configure Authentication:
      • Under Authentication, add a platform configuration for Web.
      • Set the Redirect URI to https://yourapp.com/signin-oidc (replace with your actual URL).
      • Enable ID tokens.
    3. Create Client Secret:
      • Under Certificates & secrets, create a new client secret.
      • Note down the secret value.

    Repeat the above steps for each organization's Azure AD tenant.

    2. Configure Your ASP.NET MVC 5 Application

    You need to configure your application to use OpenID Connect for authentication.

    1. Install Required NuGet Packages:
         Install-Package Microsoft.Owin.Security.OpenIdConnect 
         Install-Package Microsoft.Owin.Security.Cookies 
         Install-Package Microsoft.Owin.Host.SystemWeb
      
    2. Update Startup.cs: Configure the OWIN middleware to use OpenID Connect.
    3. Handle Authentication Requests: Update your controllers to handle authentication requests.
    4. Update Web.config: Ensure your web.config has the necessary settings for OWIN.

    Testing: Navigate to the sign-in URL for each organization and ensure the SSO process works as expected.

    By following these steps, you should be able to configure SSO for multiple organizations using Microsoft Entra ID in your ASP.NET MVC 5 application.

    Please refer the below documents for code sample.

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    Thanks,
    Raja Pothuraju.

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.