Reputation: 770
I need to login in a NodeJS application using multiple Azure AD and fetch user details. I am not sure how to achieve this?
Currently, our application is communicating with an App that is associated with the one Azure AD. Normal Users from the new Azure AD are unable to login into the our system using Office365 credentials because Office365 is not allowing our app to access the users’ profile associated with new Azure AD. But the users of new Azure AD with the role of Global Admins can log in onto our app. When normal users try to login onto our application the following message is displayed
<Name of the App> needs permission to access resources in your organization that only an admin can grant. Please ask an admin to grant permission to this app before you can use it.
Is this possible to connect to multiple Azure AD using the same application? And how to achieve this? Please add links and screenshots.
Upvotes: 2
Views: 586
Reputation: 770
People who might face a similar issue with Azure AD in the Future.
In the settings of the app that you create in the Azure AD, you can make it multi-tenant and you can also specify what type of resources/data your app needs to access. There are two types of resources/data/actions that you access for the one you require admin role and for the other you don't.
If you are trying to access data related
To make multi-tenant:
Azure AD > App Registeration > Your App > Settings > Properties
To update the permissions:
Azure AD > App Registeration > Your App > Settings > Required Permissions (Update them here)
Upvotes: 2
Reputation: 1651
How are you doing this for one AD connection pool? Here's a pseudo-code for polling multiple AD's and running functions such as authenticate
var ActiveDirectory = require('activedirectory');
var config_domain_1 = { url: 'ldap://dc.domain.com',
baseDN: 'dc=domain,dc=com',
username: '[email protected]',
password: 'password' }
var config_domain_2 = { url: 'ldap://dc.domain.com',
baseDN: 'dc=domain,dc=com',
username: '[email protected]',
password: 'password' }
var config_domain_2 = { url: 'ldap://dc.domain.com',
baseDN: 'dc=domain,dc=com',
username: '[email protected]',
password: 'password' }
var ad_domain_1 = new ActiveDirectory(config_domain_1);
var ad_domain_2 = new ActiveDirectory(config_domain_2);
var ad_domain_3 = new ActiveDirectory(config_domain_3);
ad_domain_1.authenticate(username, password, function(err, auth) {...}
Upvotes: 0