Hi,
I am using Okta with React for authentication.
And my login works fine.
As i am already logged in to browser if i open different tab then user should be auto logged in as i am already authenticated.
For this i found that i can use prompt=none in my redirect uri. How can i set this parameter, i am using oktaSignInWidget.
Okta will then check for a valid session and redirect the user back to /login/callback
If the user has a valid session, the response will be an authorization code and session can continue
if the user does NOT have a valid session, Okta will send an error and /login/callback should instead redirect to /login to show the login prompt.
Any lead for above steps implementation would be really helpful. Could you help.
I am using Okta with react.
I found below sample code from Okta Auth JS SDK. I need to provide sessionToken,state,nonce,ldp, from where i can find all these details for my application.
authClient.token.getWithoutPrompt({
sessionToken: ‘00p8RhRDCh_8NxIin-wtF5M6ofFtRhfKWGBAbd2WmE’,
scopes: [
‘openid’,
‘email’,
‘profile’
],
state: ‘8rFxxxH5q’,
nonce: ‘xxxTswrm’,
// Use a custom IdP for social authentication
idp: ‘xxxxxc8PaGpU0h7’
})
.then(function(res) {
var tokens = res.tokens;
// Do something with tokens, such as
authClient.tokenManager.setTokens(tokens);
})
.catch(function(err) {
// handle OAuthError or AuthSdkError
});