apache/hadoop · error · TokenAccessProviderException

Unable to load OAuth token provider class.

Error message

Unable to load OAuth token provider class.

What it means

Error "Unable to load OAuth token provider class." thrown in apache/hadoop.

Source

Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java:1573

                  "Failed to initialize custom ClientAssertionProvider: " + clientAssertionProviderType, e);
            }
          } else {
            // Use file-based approach (backward compatibility)
            String tokenFile =
                getTrimmedPasswordString(FS_AZURE_ACCOUNT_OAUTH_TOKEN_FILE,
                AuthConfigurations.DEFAULT_FS_AZURE_ACCOUNT_OAUTH_TOKEN_FILE);
            tokenProvider = new WorkloadIdentityTokenProvider(
                authority, tenantGuid, clientId, tokenFile);
            LOG.trace("WorkloadIdentityTokenProvider initialized with file-based token");
          }
        } else {
          throw new IllegalArgumentException("Failed to initialize " + tokenProviderClass);
        }
        return tokenProvider;
      } catch(IllegalArgumentException e) {
        throw e;
      } catch (Exception e) {
        throw new TokenAccessProviderException("Unable to load OAuth token provider class.", e);
      }

    } else if (authType == AuthType.Custom) {
      try {
        String configKey = FS_AZURE_ACCOUNT_TOKEN_PROVIDER_TYPE_PROPERTY_NAME;

        Class<? extends CustomTokenProviderAdaptee> customTokenProviderClass
            = getTokenProviderClass(authType, configKey, null,
            CustomTokenProviderAdaptee.class);

        if (customTokenProviderClass == null) {
          throw new IllegalArgumentException(
                  String.format("The configuration value for \"%s\" is invalid.", configKey));
        }
        CustomTokenProviderAdaptee azureTokenProvider = ReflectionUtils
                .newInstance(customTokenProviderClass, rawConfig);
        if (azureTokenProvider == null) {
          throw new IllegalArgumentException("Failed to initialize " + customTokenProviderClass);

View on GitHub (pinned to 2add963021)

Solutions

  1. Ensure the OAuth token provider class named in configuration is on the classpath.

When it happens

Trigger: Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java:1573 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/7f4414aafeae30fe. Report an issue: GitHub.