{"record":{"id":"c2683c921e1ad338","repo":"apache/hadoop","slug":"invalid-auth-type-s-is-being-used-expecting-sas","errorCode":null,"errorMessage":"Invalid auth type: %s is being used, expecting SAS.","messagePattern":"Invalid auth type: (.+?) is being used, expecting SAS\\.","errorType":"validation","errorClass":"SASTokenProviderException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java","lineNumber":1627,"sourceCode":"  /**\n   * Returns the SASTokenProvider implementation to be used to generate SAS token.<br>\n   * Users can choose between a custom implementation of {@link SASTokenProvider}\n   * or an in house implementation {@link FixedSASTokenProvider}.<br>\n   * For Custom implementation \"fs.azure.sas.token.provider.type\" needs to be provided.<br>\n   * For Fixed SAS Token use \"fs.azure.sas.fixed.token\" needs to be provided.<br>\n   * In case both are provided, Preference will be given to Custom implementation.<br>\n   * Avoid using a custom tokenProvider implementation just to read the configured\n   * fixed token, as this could create confusion. Also,implementing the SASTokenProvider\n   * requires relying on the raw configurations. It is more stable to depend on\n   * the AbfsConfiguration with which a filesystem is initialized, and eliminate\n   * chances of dynamic modifications and spurious situations.<br>\n   * @return sasTokenProvider object based on configurations provided\n   * @throws AzureBlobFileSystemException if SAS token provider initialization fails\n   */\n  public SASTokenProvider getSASTokenProvider() throws AzureBlobFileSystemException {\n    AuthType authType = getEnum(FS_AZURE_ACCOUNT_AUTH_TYPE_PROPERTY_NAME, AuthType.SharedKey);\n    if (authType != AuthType.SAS) {\n      throw new SASTokenProviderException(String.format(\n          \"Invalid auth type: %s is being used, expecting SAS.\", authType));\n    }\n\n    try {\n      Class<? extends SASTokenProvider> customSasTokenProviderImplementation =\n          getTokenProviderClass(authType, FS_AZURE_SAS_TOKEN_PROVIDER_TYPE,\n              null, SASTokenProvider.class);\n      String configuredFixedToken = this.getTrimmedPasswordString(FS_AZURE_SAS_FIXED_TOKEN, EMPTY_STRING);\n\n      if (customSasTokenProviderImplementation == null && configuredFixedToken.isEmpty()) {\n        throw new SASTokenProviderException(String.format(\n            \"At least one of the \\\"%s\\\" and \\\"%s\\\" must be set.\",\n            FS_AZURE_SAS_TOKEN_PROVIDER_TYPE, FS_AZURE_SAS_FIXED_TOKEN));\n      }\n\n      // Prefer Custom SASTokenProvider Implementation if configured.\n      if (customSasTokenProviderImplementation != null) {\n        LOG.trace(\"Using Custom SASTokenProvider implementation because it is given precedence when it is set.\");","sourceCodeStart":1609,"sourceCodeEnd":1645,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java#L1609-L1645","documentation":"Error \"Invalid auth type: %s is being used, expecting SAS.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AbfsConfiguration.java:1627 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set fs.azure.account.auth.type to SAS for this configuration, or use the matching auth type settings."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}