Need some help understanding getAuthCode command

Hello,

We have implemented Authenticated Web Messenger using SDK commands in our SPA. The problem we are having right now is that everytime the page is refresh, Genesys registers getAuthCode and resolves with the data. This causes our web application to refresh twice (or more if Genesys failed to exchange the token).

My understanding was that once the messenger is authenticated, it does not need to resolve again with new authCode.

  AuthProvider.registerCommand('getAuthCode', (e) => {

	// Add the necessary logic and resolve with the authCode and redirectUri provided by your Authentication provider. Messenger will call this command to get the the tokens.

	e.resolve({
		authCode: <brand auth code>,       // pass your authorization code here
		redirectUri: <your redirect uri>,  // pass the redirection URI configured in your Authentication provider here
		nonce: <your nonce>,               // pass the random string preferably in uuid format. Applicable for OKTA provider.
		maxAge: <your maxAge>,             // pass elapsed time in seconds. Applicable for OKTA provider and it is an optional parameter.
		codeVerifier: <your code verifier> // pass your code verifier here when PKCE flow is enabled
		iss: <your iss>,                   // pass your iss here. It is an optional parameter provided in the authorization response by your Authentication provider.
	});
  });
  });

Please help me clarify my understanding.

Thanks
Harshad

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.