Coder Social home page Coder Social logo

rakeshsharepointdeveloper / azureadsaml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soumikpaul-lab/azureadsaml

0.0 0.0 0.0 565 KB

ASP.Net MVC SSO with SAML

License: MIT License

JavaScript 94.56% C# 3.03% CSS 0.21% HTML 2.15% ASP.NET 0.04%

azureadsaml's Introduction

.NET Framework ASP.Net MVC application using SAML protocol to connect to Azure Active Directory (SSO)

About the sample

This sample application demonstrates how an ASP.Net MVC web application integrates with Azure AD to delegate user Authentication using SAML protocol. Therefore, providing SSO for the application.

Prerequisites

Register the SAML application to Azure Active Directory

  1. Sign in to the Azure Portal using a tenant admin account.
  2. Navigate to the Microsoft identity platform for developers Enterprise applications page.
  3. Click New Application
  4. Click Create your own application
  5. Select Non gallery app
  6. Choos a name for the application. For instance 'SampleApp' and select Create on the bottom.
  7. Under the Manage section, select Single Sign-On
  8. Select SAML and the Set up Single Sign-On with SAML page will appear.

Basic SAML configuration for your application

  1. To edit the basic SAML configuration options, select the Edit icon (a pencil) in the upper-right corner of the Basic SAML Configuration section.
  2. Set Identifier (Entity ID) with an unique URL that follows the pattern, http://{your-appName}.{your-domain}.com. For instance: http://SampleApp.contoso.com. Copy the Entity ID value to be used in later steps.
  3. Set Reply URL with the URL that Azure AD will reply after the authentication. In this sample we are using https://localhost:44311/.

Learn more about configuring SAML-based single sign-on in Azure Active Directory.

SAML Signing Certificate

  1. In the SAML Signing Certificate section, if you don't have a certificate yet, select the Edit icon (a pencil) in the upper-right corner.
  2. Select New Certificate and then Save.
  3. Close the blade, refresh the page and copy the value for App Federation Metadata Url field. We will use it on the .NET MVC project.

Configure the .NET MVC project (WebApp_SAML) to use your app registration

Open the project WebApp_SAML in your IDE (like Visual Studio) to configure the code.

  1. Open the Web.config file.
  2. Replace the value for ida:ADFSMetadata with the link that you copied from App Federation Metadata Url field.
  3. Replace the value for ida:Wtrealm with the value that you set for Identifier (Entity ID). For instance, http://SampleApp.contoso.com.
  4. Save, clean and build the solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.