ADAL, Native Apps and the “Application Not Found in Directory” Error

It’s been a little while since I’ve written a Native Azure AD app, but as I was doing so today I got poked in the eye again.  I was logging in and using my app no problem with an account from the same tenant where the app was registered in Azure AD.  However when I tried logging in with a user from a different tenant, it failed with the error message “Application with identifier xxx was not found in the directory ‘foo.com'”.

I’ve seen that before but it’s been so long that I had to do some hunting around.  I temporarily was sent off course by a suggestion I found (that seemed strangely familiar) to set the oauth2AllowImplicitFlow property to true.  That turned out to not matter at all, but it did at least get me to take a look at the manifest, rather than at the application properties in the Azure portal.

Once in the manifest I found the property that needed to be updated:  availableToOtherTenants.  Set that to true, tried my app again, and my login with a user from a different tenant worked great.  Just thought I would add this to the blog in case you get stuck in the same spot.  These things always seem to take a bit of effort to figure out.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s