@@ -11,7 +11,10 @@ import { AwsServiceWorkflow } from './mongodb_oidc/aws_service_workflow';
1111import { CallbackWorkflow } from './mongodb_oidc/callback_workflow' ;
1212import type { Workflow } from './mongodb_oidc/workflow' ;
1313
14- /** @public */
14+ /**
15+ * @public
16+ * @experimental
17+ */
1518export interface OIDCMechanismServerStep1 {
1619 authorizationEndpoint ?: string ;
1720 tokenEndpoint ?: string ;
@@ -21,21 +24,30 @@ export interface OIDCMechanismServerStep1 {
2124 requestScopes ?: string [ ] ;
2225}
2326
24- /** @public */
27+ /**
28+ * @public
29+ * @experimental
30+ */
2531export interface OIDCRequestTokenResult {
2632 accessToken : string ;
2733 expiresInSeconds ?: number ;
2834 refreshToken ?: string ;
2935}
3036
31- /** @public */
37+ /**
38+ * @public
39+ * @experimental
40+ */
3241export type OIDCRequestFunction = (
3342 principalName : string ,
3443 serverResult : OIDCMechanismServerStep1 ,
3544 timeout : AbortSignal | number
3645) => Promise < OIDCRequestTokenResult > ;
3746
38- /** @public */
47+ /**
48+ * @public
49+ * @experimental
50+ */
3951export type OIDCRefreshFunction = (
4052 principalName : string ,
4153 serverResult : OIDCMechanismServerStep1 ,
@@ -52,6 +64,7 @@ OIDC_WORKFLOWS.set('aws', new AwsServiceWorkflow());
5264
5365/**
5466 * OIDC auth provider.
67+ * @experimental
5568 */
5669export class MongoDBOIDC extends AuthProvider {
5770 /**
@@ -65,7 +78,7 @@ export class MongoDBOIDC extends AuthProvider {
6578 * Authenticate using OIDC
6679 */
6780 override auth ( authContext : AuthContext , callback : Callback ) : void {
68- const { connection, credentials, response } = authContext ;
81+ const { connection, credentials, response, reauthenticating } = authContext ;
6982
7083 if ( response ?. speculativeAuthenticate ) {
7184 return callback ( ) ;
@@ -86,7 +99,7 @@ export class MongoDBOIDC extends AuthProvider {
8699 )
87100 ) ;
88101 }
89- workflow . execute ( connection , credentials ) . then (
102+ workflow . execute ( connection , credentials , reauthenticating ) . then (
90103 result => {
91104 return callback ( undefined , result ) ;
92105 } ,
0 commit comments