-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Critical - P2
-
None
-
Affects Version/s: 2.7.0, 3.0.0
-
Component/s: Authentication
-
Dotnet Drivers
Summary
When using the IOIDCCallback interface, the returned OidcAccessToken is never refreshed, no matter what you assign to the expiresIn property. The consequence is that the token will eventually expire but will never be refreshed. Specifically, the GetOidcAccessToken or the GetOidcAccessTokenAsync methods that you need to implement from the IOidcCallback interface is only called once and never again.
Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).
c# driver version 2.7 & 3.0 (we havent tested more versions)
How to Reproduce
- Implement the IOidcCallback interface
- Create a MongoClient
- Use MongoCredential.CreateOidcCredential with the concrete implementation of the IOidcCallback interface to assign the credential.
- In a loop, query the database/collection for a document, doesn't matter what.
- Eventually, the access token will expire because the GetOidcAccessToken wont ever be called again.
Additional Background
none provided