Not quite sure, what exactly you are trying to do, and on which stage it fails for you, but to some degree it makes sense, if there is no session yet. https://developer.okta.com/docs/reference/api/sessions/#get-session states that If the session is invalid, a 404 Not Found response will be returned.
I’m having the exact same issue with the 404 error. What I am trying to do is just follow the tutorial for using the Okta SignIn Widget. Just trying to learn at this point. It seems though, that since the session cannot be retrieved, the sign in widget is displayed every time the user refreshes the page.
I could be wrong, like I said I’m just learning, but I thought the session would be a way to keep the user logged in for a period of time without re-submitting credentials.
The call to renderEl() displays the widget just fine and once the user signs in it even returns a session with status 'ACTIVE' plus a token. However, the subsequent call to authClient.session.get() still returns {status: "INACTIVE"}.
I can’t figure out how to tell if the user is signed in.
oh, now I see. I think it’s b/c after you got SUCCESS you have a session token on hands, but not the session cookie which would mean, that you have a session.
From the documentation you are supposed to do something like:
function success(res) {
if (res.status === 'SUCCESS') {
res.session.setCookieAndRedirect('https://example.com/dashboard');
}
}
only after that, I believe, you will have a session cookie, hence the session