Something
Something

Reputation: 1

AADSTS65005 error on adal.js multi-tenant authentication

I am trying to integrate adal.js into our SPA with multi-tenant enabled. I followed the instruction here to configured the AAD App.

I enabled MULTI-TENANT to yes and set oauth2AllowImplicitFlow to true.

Here is the code I used to setup the adal.js

adalProvider.init( { clientId: sessionStorage.getItem(Constant.adalHelper.AadAppId), endpoints: angular.fromJson(sessionStorage.getItem(Constant.adalHelper.AdalResourceMap)), extraQueryParameter: "nux=1", instance: sessionStorage.getItem(Constant.adalHelper.AadInstance), popUp: false, redirectUri: window.location.origin + "/login", requireADLogin: true, tenant: sessionStorage.getItem(Constant.adalHelper.AadTenant) }, $httpProvider); When I set the tenant to the tenant name of AAD app, everything works just fine. However, as soon as I change the tenant to “Common”. The authentication failed the error as below:

AADSTS65005:The application 'https://xxxxxxx/xxxxxx' asked for permissions to access a resource that has been removed or is no longer available. Contact the app vendor.

Upvotes: 0

Views: 577

Answers (1)

Fei Xue
Fei Xue

Reputation: 14649

Based on the description you were developing multi-tier applications for the multi-tenant.

There are two scenarios for the multi-tier applications.

One is the multiple tiers in a single tenant(both the client and resource app are on the developer's tenant). In this scenario, we need to add the client to the resource's knowClientApplications.

Second scenario is that multiple tiers in multiple tenants(the client and resource app are in different tenant). In this scenario, the users need to grant the permission separately. First he/she need to grant the permission of resource app and then he/she can using grant the client app.

Based on the error message, please ensure that the resource app is available to make it work for the client app. More detail about the multi-tenant apps scenario, you can refer this link.

Upvotes: 0

Related Questions