React Integration Example Logout Issue


Did anybody manage to follow the example react integration steps that is in the developer portal?

I had it partially working, after correcting a typo in example and setting up CORS for localhost, but logout action is failing.

In code, auth.logout makes request DELETE https://{org-url}/api/v1/sessions/me and that returns 404.

Not sure if I need to do any other settings in admin portal or not.

Thanks in advance!

According to Okta documentation for Sessions

If the session was successfully closed, a 204 No Content response will be returned.

If the session is invalid, a 404 Not Found response will be returned.

Not sure why I am getting 404…

1 Like

Same error with same example.

@mraible can you help here?

Sorry for the delay here. Are you using the React + SignIn Widget or the React Auth SDK integration?

I was using withAuth component (so is it called SDK?).

Hey Anatoly:

Yes. The withAuth component is part of the @okta/okta-react SDK. I will build run through the quick start this weekend and see if I can replicate the issue. If not, I’ll send you a github repo so you can compare what you have.


I followed the example at: and haven’t been able to reproduce a logout error.

The only thing I can think of is either the docs were recently updated (possible) or it possible that your CORS endpoint may not be set up correctly. Attached is a screenshot of the one I have set up.

Hope this helps. Please let me know if following the docs (in case they’re updated) results in the same error.

Lee Brandt

the point is that in following tutorial httpsut:// mentioned only Login redirect URIs but not Logout

Totally understand 100%, right now the quickstarts are truly quickstarts. Getting you set up for authentication and then dropping the mic. There is some work for Okta to do to merchandise next steps. Look for some changes soon.

Are you still having the error?

I’m getting the other thing. When pressing logout button i’m getting the following response:

!Request URL:
Request Method:DELETE
Status Code:204 No Content

but it doesn’t redirects while i have:

and the following code:

function onAuthRequired({history}) {

class App extends Component {

  render() {

    return (
        <Security issuer={config.issuer}
          <Route path='/' exact={true} component={Home}/>
          <Route path='/login' exact={true} component={Home}/>
          <Route path='/implicit/callback' component={ImplicitCallback} />

So the problem was in absence of the following lines:

componentDidUpdate() {

which are presented in but not in

Thanks for reporting this! I’ve entered an issue for it.