ADAL-Node: Tenant organizations not found

423 views Asked by At

if the authority url is something like https://login.microsoftonline.com/domainName (where the domain name is a domain associated with your tenant) I get the following error

Get Token request returned http error: 400 and server response:error description AADSTS90002 Tenant 'organizations' not found This may happen if there are no active subscriptions for the tenant. Check to make sure you have the correct tenant ID

the code works fine in case the authority_url is something like https://login.microsoftonline.com/{Guid} (where the Guid is the tenant ID)

sample code:

var authorityUrl = 'https://login.microsoftonline.com/organizations';
var authContext = new AuthenticationContext(authorityUrl, undefined, undefined, '');
var token = await this.authContext.acquireTokenWithClientCredentials(this.resourceId, this.clientId, this.clientSecret);

Using "adal-node": "0.2.1"

1

There are 1 answers

0
MMThornberg On BEST ANSWER

The error message states that the tenant you have specified ("organizations") does not exist. Try providing a valid tenant name instead.
I.e. https://login.microsoftonline.com/YourOrgName.onmicrosoft.com where "YourOrgName.onmicrosoft.com" should be replaced with your tenant name.