@@ -499,9 +499,13 @@ export class UserAgentApplication {
499
499
*
500
500
*/
501
501
private async acquireTokenHelper ( account : Account , interactionType : InteractionType , isLoginCall : boolean , request : AuthenticationParameters , resolve ?: any , reject ?: any ) : Promise < void > {
502
+ this . logger . verbose ( "AcquireTokenHelper has been called" ) ;
503
+ this . logger . verbose ( `Interaction type: ${ interactionType } . isLoginCall: ${ isLoginCall } ` ) ;
504
+
502
505
// Track the acquireToken progress
503
506
this . cacheStorage . setItem ( TemporaryCacheKeys . INTERACTION_STATUS , Constants . inProgress ) ;
504
507
const scope = request . scopes ? request . scopes . join ( " " ) . toLowerCase ( ) : this . clientId . toLowerCase ( ) ;
508
+ this . logger . verbosePii ( `Serialized scopes: ${ scope } ` ) ;
505
509
506
510
let serverAuthenticationRequest : ServerRequestParameters ;
507
511
const acquireTokenAuthority = ( request && request . authority ) ? AuthorityFactory . CreateInstance ( request . authority , this . config . auth . validateAuthority , request . authorityMetadata ) : this . authorityInstance ;
@@ -530,11 +534,14 @@ export class UserAgentApplication {
530
534
request . state ,
531
535
request . correlationId
532
536
) ;
537
+ this . logger . verbose ( "Finished building server authentication request" ) ;
533
538
534
539
this . updateCacheEntries ( serverAuthenticationRequest , account , isLoginCall , loginStartPage ) ;
540
+ this . logger . verbose ( "Updating cache entries" ) ;
535
541
536
542
// populate QueryParameters (sid/login_hint) and any other extraQueryParameters set by the developer
537
543
serverAuthenticationRequest . populateQueryParams ( account , request ) ;
544
+ this . logger . verbose ( "Query parameters populated from account" ) ;
538
545
539
546
// Construct urlNavigate
540
547
const urlNavigate = UrlUtils . createNavigateUrl ( serverAuthenticationRequest ) + Constants . response_mode_fragment ;
@@ -543,18 +550,26 @@ export class UserAgentApplication {
543
550
if ( interactionType === Constants . interactionTypeRedirect ) {
544
551
if ( ! isLoginCall ) {
545
552
this . cacheStorage . setItem ( `${ TemporaryCacheKeys . STATE_ACQ_TOKEN } ${ Constants . resourceDelimiter } ${ request . state } ` , serverAuthenticationRequest . state , this . inCookie ) ;
553
+ this . logger . verbose ( "State cached for redirect" ) ;
554
+ this . logger . verbosePii ( `State cached: ${ serverAuthenticationRequest . state } ` ) ;
555
+ } else {
556
+ this . logger . verbose ( "Interaction type redirect but login call is true. State not cached" ) ;
546
557
}
547
558
} else if ( interactionType === Constants . interactionTypePopup ) {
548
559
window . renewStates . push ( serverAuthenticationRequest . state ) ;
549
560
window . requestType = isLoginCall ? Constants . login : Constants . renewToken ;
561
+ this . logger . verbose ( "State saved to window" ) ;
562
+ this . logger . verbosePii ( `State saved: ${ serverAuthenticationRequest . state } ` ) ;
550
563
551
564
// Register callback to capture results from server
552
565
this . registerCallback ( serverAuthenticationRequest . state , scope , resolve , reject ) ;
553
566
} else {
567
+ this . logger . verbose ( "Invalid interaction error. State not cached" ) ;
554
568
throw ClientAuthError . createInvalidInteractionTypeError ( ) ;
555
569
}
556
570
557
571
if ( interactionType === Constants . interactionTypePopup ) {
572
+ this . logger . verbose ( "Interaction type is popup. Generating popup window" ) ;
558
573
// Generate a popup window
559
574
try {
560
575
popUpWindow = this . openPopup ( urlNavigate , "msal" , Constants . popUpWidth , Constants . popUpHeight ) ;
0 commit comments