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.
This should work in your use case as well.
When logging in using the okta-signin-widget (I’m using it with okta-react), SSO does not work across other apps also using the widget. I’m logged into Okta, if I navigate to the Okta developer dashboard, but not my other apps which use the widget as well.
I’ve narrowed this issue down to the logic around the method .isAuthenticated() inside okta-react/src/Auth.js. This method only checks if either the access or id token exist in client storage, not also if a session exists in Okta. Is this a b…
When you open a new tab that application could do a
token.getWithoutPrompt(options) using the okta-auth-js SDK.
@ajm @erik ,
In order to implement single session per user across the browser, i am planning to do following things -
The idea is to redirect from [
http://localhost:300](the root URL) to https://xxxx/oauth2/default/v1/authorize?response_type=code&prompt=none&client_id=xxxxx&scope=…&nonce=…&state=…&redirect_uri=http://localhost:3000/login/callback (insert scope, nonce and state parameters as required) 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.
// Use a custom IdP for social authentication
var tokens = res.tokens;
// Do something with tokens, such as
// handle OAuthError or AuthSdkError