Skip to content

riganti/dotvvm-samples-azuread-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Active Directory Authentication Sample for DotVVM

This is a sample app featuring the Azure Active Directory authentication sample for DotVVM.

Prerequisites

  1. Sign in to the Azure Portal and open (or create) your Azure Active Directory resource.

  2. Open the Overview tab and copy the Directory ID value. Paste it in the TenantId application setting in the web.config file in OWIN or appsettings.json in ASP.NET Core.

  3. Open the App registrations tab and open (or create) the app registration.

  4. Copy the Application ID value and paste it in the ClientId application setting in the web.config or appsettings.json file.

  5. Make sure that the URL on which the web app is running, is listed in the Home Page field or in the Reply URLs section. The URL must match including the HTTP/HTTPS and port.

  6. In ASP.NET Core version, set the PostLogoutRedirectUri application setting to the application root URL.

Now the application should work with all accounts from the directory.

Note: If you decide to use code response type instead of default id_token, generate and set ClientSecret in the configuration file as well. The secret can be generated in App registrations page in the Authentication section.

Multi-Tenancy Option

If you want to make the application multi-tenant (to allow the users to sign in even if they are from a different Azure Active Directory tenant), you need to make these changes:

  1. In the Properties tab of the App Registration, switch the Multi-tenanted field to Yes.

  2. In the web.config or appsettings.json, change the TenantId to the value common.

How to run the sample

  1. Open the GitHub repo in Visual Studio or git clone https://github.com/riganti/dotvvm-samples-dotvvm-samples-azuread-auth.git

  2. Open AspNetCore/DotvvmAuthSample/DotvvmAuthSample.sln (ASP.NET Core) or Owin/DotvvmAuthSample/DotvvmAuthSample.sln (.NET Framework with OWIN)

  3. Right-click the DotvvmAuthSample project and select View > View in Browser

What you can learn in the sample

  • How to configure Azure Active Directory authentication in a DotVVM application (see Authentication page in the DotVVM Docs to find more info)

Other resources

About

Azure Active Directory authentication sample for DotVVM

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages