@@ -11,7 +11,10 @@ import { AwsServiceWorkflow } from './mongodb_oidc/aws_service_workflow';
11
11
import { CallbackWorkflow } from './mongodb_oidc/callback_workflow' ;
12
12
import type { Workflow } from './mongodb_oidc/workflow' ;
13
13
14
- /** @public */
14
+ /**
15
+ * @public
16
+ * @experimental
17
+ */
15
18
export interface OIDCMechanismServerStep1 {
16
19
authorizationEndpoint ?: string ;
17
20
tokenEndpoint ?: string ;
@@ -21,21 +24,30 @@ export interface OIDCMechanismServerStep1 {
21
24
requestScopes ?: string [ ] ;
22
25
}
23
26
24
- /** @public */
27
+ /**
28
+ * @public
29
+ * @experimental
30
+ */
25
31
export interface OIDCRequestTokenResult {
26
32
accessToken : string ;
27
33
expiresInSeconds ?: number ;
28
34
refreshToken ?: string ;
29
35
}
30
36
31
- /** @public */
37
+ /**
38
+ * @public
39
+ * @experimental
40
+ */
32
41
export type OIDCRequestFunction = (
33
42
principalName : string ,
34
43
serverResult : OIDCMechanismServerStep1 ,
35
44
timeout : AbortSignal | number
36
45
) => Promise < OIDCRequestTokenResult > ;
37
46
38
- /** @public */
47
+ /**
48
+ * @public
49
+ * @experimental
50
+ */
39
51
export type OIDCRefreshFunction = (
40
52
principalName : string ,
41
53
serverResult : OIDCMechanismServerStep1 ,
@@ -52,6 +64,7 @@ OIDC_WORKFLOWS.set('aws', new AwsServiceWorkflow());
52
64
53
65
/**
54
66
* OIDC auth provider.
67
+ * @experimental
55
68
*/
56
69
export class MongoDBOIDC extends AuthProvider {
57
70
/**
@@ -65,7 +78,7 @@ export class MongoDBOIDC extends AuthProvider {
65
78
* Authenticate using OIDC
66
79
*/
67
80
override auth ( authContext : AuthContext , callback : Callback ) : void {
68
- const { connection, credentials, response } = authContext ;
81
+ const { connection, credentials, response, reauthenticating } = authContext ;
69
82
70
83
if ( response ?. speculativeAuthenticate ) {
71
84
return callback ( ) ;
@@ -86,7 +99,7 @@ export class MongoDBOIDC extends AuthProvider {
86
99
)
87
100
) ;
88
101
}
89
- workflow . execute ( connection , credentials ) . then (
102
+ workflow . execute ( connection , credentials , reauthenticating ) . then (
90
103
result => {
91
104
return callback ( undefined , result ) ;
92
105
} ,
0 commit comments