snvijaya opened a new pull request #2034: URL: https://github.com/apache/hadoop/pull/2034
When AuthType and Auth token provider configs are set for both generic (account-agnostic) and account-specific config, as below: // account agnostic fs.azure.account.auth.type=CUSTOM fs.azure.account.oauth.provider.type=ClassExtendingCustomTokenProviderAdapter // account specific fs.azure.account.auth.type.account_name=OAuth fs.azure.account.oauth.provider.type.account_name=ClassExtendingAccessTokenProvider Effective token provider for 'account_name' is expected to be ClassExtendingAccessTokenProvider. But currently, when the token provider class is being read from the config, account-agnostic config setting is read first in the assumption that it can serve as default if account-specific config setting is absent. This logic leads to failure such as in above case where AuthType for account-specific and AuthType for account-agnostic are different. This is because the Interface implementing the token provider is different for various Auth Types (For Custom AuthType it is CustomTokenProviderAdapter and for OAuth it is AccessTokenProvider). This leads to a Runtime exception when trying to create the oAuth access token provider. In this PR, getTokenProvider() is fixed to check for account-specific token provider configuration first. In its absence, account-agnostic token provider configuration is read only if account-specific and account-agnostic AuthType setting is same (otherwise expected token provider interface is different). The same logic applies while determining SAS Token provider too, hence that has been updated as well. Testing is done with combinations of Custom and OAuth settings in account-specific and account-agnostic configs and determining which is in effect. Tested getSASTokenProvider which uses the same logic to find the effective token provider with SAS set for both account-specific and account-agnostic configs. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org