Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection string with access token that expires every 24h #68

Open
lupustom-ecarup opened this issue Mar 5, 2024 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@lupustom-ecarup
Copy link

Hello everyone,
Is there a way to pass an access credential instead of a fixed connection string? We are using using an Azure hosted PostgreSQL server and connect to it everywhere using managed identity where the access token expires every 24h.
Thanks!

@SeppPenner SeppPenner self-assigned this Mar 5, 2024
@SeppPenner SeppPenner added the enhancement New feature or request label Mar 5, 2024
@phillip-haydon
Copy link

Just came here looking to see if anyone else run into this, using AWS with IAM Role which generates 15 minute tokens. For EF I can use

dataSourceBuilder.UsePeriodicPasswordProvider(
    (settings, cancellationToken) =>  /* async code to fetch the new access token */,
    TimeSpan.FromMinutes(55), // Interval for refreshing the token
    TimeSpan.FromSeconds(5)); // Interval for retrying after a refresh failure

https://www.npgsql.org/doc/security.html?tabs=tabid-1#auth-token-rotation-and-dynamic-password

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants