The DNN Azure Active Directory Provider is an Authentication provider for DNN Platform (formerly DotNetNuke) that uses Azure Active Directory OAuth2 authentication to authenticate users.
Looking for the DNN Azure AD B2C provider? Go to https://github.com/intelequia/dnn.azureadb2cprovider
The DNN Azure Active Directory Provider is an Authentication provider for DNN Platform that uses Azure Active Directory OAuth2 authentication to authenticate users.
This guide has two parts:
Following this two steps, you will give access to all your Azure AD users to register and sign-in into your DNN application. You can go later and harden your security settings like only allow to access the DNN Web Application to certain users on the Azure portal. Also note that depending on whether you have “Public” or “Private” user account registration on your DNN portal, you will need to approve the registered user before allowing him to access the site.
To support the role and profile synchronization by internally using the Microsoft Graph API, a service principal is needed to call the API. To setup the service principal:
Click on the name of the app we’ve just created and then on “All settings” > “API permissions” > “Microsoft Graph”. Ensure that the app has, at least the following API Permissions over the MS Graph API:
Click on the Grant permissions button and then click on “Yes” to grant the permissions in all the accounts in the current directory.
IMPORTANT: you won't be able to copy this key later, so copy it now or generate a new one when needed.
It’s important to remember that you need a DNN deployment with version 7.4.1 or later for v1.0.1 and version 9.0.0 or later for v3.0 to continue.
The settings page is very straightforward. You only have to change four parameters to get the implementation to work:
And with that everything will be ready! For further configuration, you may check our wiki page.
From the comman line, enter the <RepoRoot>\DotNetNuke.Authentication.Azure\AzureAD.Web
and run the following commands:
npm install -g webpack
npm install -g webpack-cli
npm install -g webpack-dev-server --force
npm install --force
To debug the client side, build the module in debug mode and copy the .dll and .pdb files into your site /bin folder (you can tweak the post build event for such purpose). That will try to load the persona bar bundle script from https://localhost:8080.
The second step is to start the local webpack dev server. To do it,
From the command line, enter the <RepoRoot>\DotNetNuke.Authentication.Azure\AzureAD.Web
and run the following commands:
webpack-dev-server
Now you can build the solution by opening the DotNetNuke.Authentication.Azure.sln file on Visual Studio. Building the solution in “Release”, will generate the React bundle and package it all together with the installation zip file, created under the “\releases” folder.
On the Visual Studio output window you should see something like this:
1>------ Rebuild All started: Project: DotNetNuke.Authentication.Azure, Configuration: Release Any CPU ------
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3277: Found conflicts between different versions of "Newtonsoft.Json" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
1> DotNetNuke.Authentication.Azure -> C:\Dev\dnn.azureadprovider\DotNetNuke.Authentication.Azure\bin\DotNetNuke.Authentication.Azure.dll
1> Hash: 96cf8fcd3ef2c4a72565
1> Version: webpack 1.13.0
1> Time: 4922ms
1> Asset Size Chunks Chunk Names
1> bundle-en.js 345 kB 0 [emitted] main
1> + 43 hidden modules
1>
1> WARNING in bundle-en.js from UglifyJs
1> Condition always false [./~/style-loader/addStyles.js:24,0]
1> Dropping unreachable code [./~/style-loader/addStyles.js:25,0]
1> Condition always true [./src/containers/Root.js:2,4]
1> Dropping unreachable code [./src/containers/Root.js:5,4]
1> Condition always false [./~/style-loader!./~/css-loader!./~/less-loader!./src/components/general/generalSettings.less:10,0]
1> Dropping unreachable code [./~/style-loader!./~/css-loader!./~/less-loader!./src/components/general/generalSettings.less:12,0]
1> Side effects in initialization of unused variable update [./~/style-loader!./~/css-loader!./~/less-loader!./src/components/general/generalSettings.less:7,0]
1> Condition always false [./~/style-loader!./~/css-loader!./~/less-loader!./src/components/style.less:10,0]
1> Dropping unreachable code [./~/style-loader!./~/css-loader!./~/less-loader!./src/components/style.less:12,0]
1> Side effects in initialization of unused variable update [./~/style-loader!./~/css-loader!./~/less-loader!./src/components/style.less:7,0]
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========