Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Azure Active Directory Authentication Sample for DotVVM

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


  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

  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


Azure Active Directory authentication sample for DotVVM








No releases published


No packages published