aws / aws/amazon-redshift-odbc-driver
Ability to cache AzureAD access tokens for Azure AD Browser OAuth2
- Dominant language
- C
- Stars
- 25
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
**Driver version**
2.1.11.0
**Client Operating System**
Windows 11
**Problem description**
When using the Identity Provider - Azure AD Browser OAuth2 option, it works fine when you test it however each request the driver does generates a new request for an access token, which spams the "Thank you for using Amazon Redshift! You can now close this window." which is very annoying for end users, and if you use PowerBI with this method the users account can get locked out due to so many requests.
Are we able to have a feature added to cache the access tokens for a period of time and reuse them for subsequent queries until expiry this would help this issue so much.
**ODBC trace logs**
Multiple entries of the following, which coincide with new browser pop-ups:
[DEBUG] 2025-11-27 02:00:02.862 [IAMCRD:IAMBrowserAzureOAuth2CredentialsProvider.cpp:289] [23932] [pid:19376] IAMBrowserAzureOAuth2CredentialsProvider::RequestAccessToken
**Reproduction code**
I was able to reproduce the issue clicking on Test button repeatedly of a DSN with the following parameters defined, or using this DSN with Excel/PowerBI to query the DSN:
Data Source Name
Server
Port
Database
Auth type --> Set to Identity Provider: Browser Azure AD OAUTH2
Azure Client ID
Idp Tenant
Contributor guide
Research direction
Start by reading IAMBrowserAzureOAuth2CredentialsProvider.cpp, especially RequestAccessToken, and reproduce the repeated browser prompts using the DSN Test button or PowerBI. Trace how tokens are requested and retained, then verify that subsequent queries reuse a token until expiry without opening new browser prompts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, c
- Domain
- authentication
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100