access_denied error while login to multi-tenant app with external user

Viewed 2714

I Have implemented Multi tenant app.I have able login from other directory and same directory user but when i'm login with the external user or guest user then i'm getting access_denied error.

Eg:My directory domainname like sample.onmicrosoft.com.The user with test@sample.onmicrosoft.com able to login to my app but when the user like test@sample-softwaresolutions.com not able to login my app.

Error like below

#error=access_denied&error_description=AADSTS65005%3a+Using application is currently not supported for your Organizationname.com.com because it is in an unmanaged state. An administrator needs to claim ownership of the company by DNS validation of Organizationname.com. before the application AppName can be provisioned.%0d%0aTrace+ID%3a+1cc5197f-2580-4b09-8f22-e2ad20520900%0d%0aCorrelation+ID%3a+13c719cf-ee2a-49d0-bb11-e9b84fb15843%0d%0aTimestamp%3a+2017-09-24+12%3a20%3a03Z&state=b2662aef-dd29-4a80-b6fd-09e47d991934

or see the below image

enter image description here

Any Answer Appreciated

Thanks in Advance......!

2 Answers

As the message says, you will have to verify your domain [DNS verification] as per the details given here

There are two modes to convert to managed app

Internal Takeover Let's say an IT administrator from Bellows College discovers that users from the school have signed up for self-service offerings. As the registered owner of the DNS name BellowsCollege.com, the IT administrator can validate ownership of the DNS name in Azure and then take over the unmanaged directory. The directory then becomes a managed directory, and the IT administrator is assigned the global administrator role for the BellowsCollege.com directory.

External Takeover For example, let's say you are an IT administrator and you already have a managed directory for Contoso.com, a domain name that is registered to your organization. You discover that users from your organization have performed self-service sign up for an offering by using email domain name user@contoso.co.uk, which is another domain name that your organization owns. Those users currently have accounts in an unmanaged directory for contoso.co.uk.

There are more details on the given link.

This is expected error because when the multi-tenant app is using common in the authorization endpoint. And Azure AD determine the Azure Active Directory by the account users input. So the Azure AD will take the default Azure Active Directory instead of the tenant the account was added to as a external users. This is reasonable since we may add the same users to many other directories.

So if we want the login with the external users for the multi-tenant app, we should use the specific tenant in the authorization endpoint instead of using common.

Related