I have a react application that is currently configured with our Okta (SP) with ODIC authentication. We decided to allow another Okta Org to access our application. This new Okta is the IDP and they are using the saml2 protocol. So we managed to do the setup between the 2 Okta correctly.
When we run the application that is based on Okta-sign-in-widget library self hosted widget. The application ask for the user name to identify which Okta to authenticate with, in the case of IDP users, the application redirect the user to the IDP login page and then after it finish authentication from the user, it will redirect the user back to the react app. The issue is that I’m not able to extract the token, and the 2 Okta doesn’t store any cookies about the authentication in order to check if the user is authentication is done or not. I can see from Okta System logs the user is authenticated successfully. I’m struggling in this flow anyone have encounter a similar use case ?
The code I’m using to try checking for session if it’s created or not to authentication is
const session = yield call(oktaAuth.session.exists);
if (session) {
const response = yield call(oktaAuth.token.getWithoutPrompt);
oktaAuth.tokenManager.setTokens(response.tokens);
}