Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

AADSTS90002: Tenant authorize not found : Occurs after update pkg from 3.19.8 -> 4.0.0 #1346

@iomdesign

Description

@iomdesign

Which Version of ADAL are you using ?
ADAL 4.0.0

Which platform has the issue?

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Auth
    • Username Password
    • Device code flow (browserless)
  • Web App
    • Authorization code
    • OBO
  • Web API
    • OBO

Other? - please describe;
Headless console app - client credentials flow

Repro

    public class OAuthConfiguration : IOAuthConfiguration
    {
        public string ClientId { get; set; }
        public string ClientSecret { get; set; }
        public string Authority { get; set; }
        public string Resource { get; set; }

    }

    public class OAuthProvider : IOAuthProvider
    {

        private readonly AuthenticationContext authContext;
        private AuthenticationResult authResult;
        private readonly OAuthConfiguration config;

...
        public OAuthProvider(
            OAuthConfiguration config,
            AuthenticationContext authContext
        )
        {
            this.authContext = authContext;
            this.config = config;
        }

        public async Task<AuthenticationResult> GetTokenAsync()
        {
            if (IsTokenExpired())
            {
                try
                {
                    var clientCredential = new ClientCredential(config.ClientId, config.ClientSecret);
                    this.authResult = await authContext.AcquireTokenAsync(config.Resource, clientCredential);

                }
                catch (Exception ex)
                {
                    logger.Error(
                        $"AUTH PROVIDER :: Failed to retrieve token :: {ex.message}");
                }
            }
            return this.authResult;
}

Expected behavior
Using ADAL 3.19.8, the same code and credentials successfully returns an AuthenticaionResult containing a valid bearer token .

Actual behavior
Exception thrown

AADSTS90002: Tenant authorize not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator.
Trace ID: 9a1bb16e-0cdf-4dd4-8a4b-a888a2650e00
Correlation ID: 0aefb133-0763-426e-b0c3-4bb373b7a60d
Timestamp: 2018-10-23 09:31:20Z

Possible Solution

Additional context/ Logs / Screenshots
Add any other context about the problem here, such as logs and screebshots. Logging is described at https://github.com/AzureAD/azure-activedirectory-library-for-dotnet/wiki/Logging-in-ADAL.Net

Another application using the same code and credentials but using ADAL 3.19.8 is still wrking as expected.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions