Skip to content

Ability to cache AzureAD access tokens for Azure AD Browser OAuth2 #34

@MangoAndFish22

Description

@MangoAndFish22

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions