@@ -61,21 +61,18 @@ export class CallbackWorkflow implements Workflow {
61
61
'Auth mechanism property REQUEST_TOKEN_CALLBACK is required.'
62
62
) ;
63
63
}
64
- console . log ( 'RESPONSE' , response ) ;
65
64
// Look for an existing entry in the cache.
66
65
const entry = this . cache . getEntry (
67
66
connection . address ,
68
67
credentials . username ,
69
68
requestCallback ,
70
69
refreshCallback || null
71
70
) ;
72
- console . log ( 'ENTRY' , entry , entry ?. isValid ( ) ) ;
73
71
let result ;
74
72
// Reauthentication must go through all the steps again regards of a cache entry
75
73
// being present.
76
74
if ( entry && ! reauthenticating ) {
77
75
if ( entry . isValid ( ) ) {
78
- console . log ( 'FINISHING' ) ;
79
76
// Presence of a valid cache entry means we can skip to the finishing step.
80
77
result = await this . finishAuthentication (
81
78
connection ,
@@ -84,7 +81,6 @@ export class CallbackWorkflow implements Workflow {
84
81
response ?. speculativeAuthenticate ?. conversationId
85
82
) ;
86
83
} else {
87
- console . log ( 'FETCH AND FINISH' ) ;
88
84
// Presence of an expired cache entry means we must fetch a new one and
89
85
// then execute the final step.
90
86
const tokenResult = await this . fetchAccessToken (
@@ -103,7 +99,6 @@ export class CallbackWorkflow implements Workflow {
103
99
) ;
104
100
}
105
101
} else {
106
- console . log ( 'NO ENTRY IN CACHE' ) ;
107
102
// No entry in the cache requires us to do all authentication steps
108
103
// from start to finish, including getting a fresh token for the cache.
109
104
const startDocument = await this . startAuthentication (
@@ -112,12 +107,10 @@ export class CallbackWorkflow implements Workflow {
112
107
reauthenticating ,
113
108
response
114
109
) ;
115
- console . log ( 'START DOCUMENT' , startDocument ) ;
116
110
const conversationId = startDocument . conversationId ;
117
111
const serverResult = BSON . deserialize (
118
112
startDocument . payload . buffer
119
113
) as OIDCMechanismServerStep1 ;
120
- console . log ( 'SERVER_RESULT' , serverResult ) ;
121
114
const tokenResult = await this . fetchAccessToken (
122
115
connection ,
123
116
credentials ,
@@ -189,38 +182,32 @@ export class CallbackWorkflow implements Workflow {
189
182
requestCallback : OIDCRequestFunction ,
190
183
refreshCallback ?: OIDCRefreshFunction
191
184
) : Promise < OIDCRequestTokenResult > {
192
- console . log ( 'FETCH ACCESS TOKEN' ) ;
193
185
// Get the token from the cache.
194
186
const entry = this . cache . getEntry (
195
187
connection . address ,
196
188
credentials . username ,
197
189
requestCallback ,
198
190
refreshCallback || null
199
191
) ;
200
- console . log ( 'ENTRY' , entry ) ;
201
192
let result ;
202
193
const clientInfo = { principalName : credentials . username , timeoutSeconds : TIMEOUT_S } ;
203
194
// Check if there's a token in the cache.
204
195
if ( entry ) {
205
196
// If the cache entry is valid, return the token result.
206
197
if ( entry . isValid ( ) && ! reauthenticating ) {
207
- console . log ( 'ENTRY IS VALID AND NOT REAUTHENTICATING' ) ;
208
198
return entry . tokenResult ;
209
199
}
210
200
// If the cache entry is not valid, remove it from the cache and first attempt
211
201
// to use the refresh callback to get a new token. If no refresh callback
212
202
// exists, then fallback to the request callback.
213
203
if ( refreshCallback ) {
214
204
result = await refreshCallback ( clientInfo , startResult , entry . tokenResult ) ;
215
- console . log ( 'USING REFRESH CALLBACK' , result ) ;
216
205
} else {
217
206
result = await requestCallback ( clientInfo , startResult ) ;
218
- console . log ( 'USING REQUEST CALLBACK, NO REFRESH FOUND' , result ) ;
219
207
}
220
208
} else {
221
209
// With no token in the cache we use the request callback.
222
210
result = await requestCallback ( clientInfo , startResult ) ;
223
- console . log ( 'USING REQUEST CALLBACK, NO TOKEN IN CACHE' , result ) ;
224
211
}
225
212
// Validate that the result returned by the callback is acceptable.
226
213
if ( isCallbackResultInvalid ( result ) ) {
0 commit comments