Description: We are using OKTA SSO login in one of our application. We are using the below package.
“@okta/okta-auth-js”: “^5.5.0”,
“@okta/okta-react”: “^6.2.0”,
We are using PKCE mode for SPA.
The issue here is each time we send a request there is a delay of 10-12 second consistently on each mentioned below call.
Below are the sequence of each calls.
https://dev-490079.okta.com/oauth2/aus39le04eDAfhtFN4x7/.well-known/openid-configuration
Request URL: https://dev-490079.okta.com/oauth2/aus39le04eDAfhtFN4x7/v1/token
Request URL: https://dev-490079.okta.com/oauth2/aus39le04eDAfhtFN4x7/v1/keys
Request URL: https://dev-490079.okta.com/oauth2/aus39le04eDAfhtFN4x7/v1/userinfo
Can you please share the details. Below is the sample code for your reference.
const oktaAuth = new OktaAuth({
issuer: data.Issuer,
redirectUri: `${window.location.origin}/implicit/callback`,
clientId: data.Client_id,
tokenManager: {
storage: 'sessionStorage'
},
storageManager: {
token: {
storageType: 'sessionStorage',
storageTypes: []
},
cache: {
storageType: 'sessionStorage',
storageTypes: []
},
transaction: {
storageType: 'sessionStorage',
storageTypes: []
}
}
});
const restoreOriginalUri = async (_oktaAuth, originalUri) => {
debugger;
window.location.replace('/');
};
oktaAuth.tokenManager.on('error', function (err) {
if (err.errorCode === 'login_required') {
window.location.href = "Unauthorized";
}
});