# Getting response 404 for OIDC Logout API call

**URL:** <https://devforum.okta.com/t/getting-response-404-for-oidc-logout-api-call/13020>\
**Category:** OAuth/OIDC\
**Tags:** api\
**Created:** [February 22, 2021, 8:01am UTC](https://devforum.okta.com/t/getting-response-404-for-oidc-logout-api-call/13020 "2021-02-22T08:01:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![balamurali.k](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@balamurali.k](https://devforum.okta.com/u/balamurali.k)\
**Post date:** [February 22, 2021, 8:01am UTC](https://devforum.okta.com/t/getting-response-404-for-oidc-logout-api-call/13020/1 "2021-02-22T08:01:27Z")

</div>

Wrote custom code for logout functionality as Login initiated by App only.

## LOGIN Configuration at Okta

* * *

Login redirect URIs : [http://localhost](http://localhost):xxxx/ice

Logout redirect URIs : [http://localhost](http://localhost):xxxx/ice/#/login

Login initiated by : App only

Initiate login URI : [http://localhost](http://localhost):xxxx/ice

Getting this page after logout. Page getting logout from next time if i click on sign in using okta not redirecting to Okta for authentication.

And for logout used the url : [https://dev-xxxxxxxx.okta.com/logout](https://dev-xxxxxxxx.okta.com/logout) in my application. SSO implemented by OIDC.

 - Page Not Found

```
            <script src="https://ok12static.oktacdn.com/assets/js/mvc/dll-common/dll.common.pack.8b078a70179c3025d5886ae18e26c728.js" crossorigin="anonymous" integrity="sha384-UjcwIO9r3xsVTlvL+/rlc8zIrl/nQoYm8i9IoaS/2I9gCQdTTDC6jQep8/x3jbqo" type="text/javascript"></script><script src="https://ok12static.oktacdn.com/assets/js/mvc/init-dll/main-init-dll.pack.40b602e77aa81c6e4824ee0d881edd3c.js" crossorigin="anonymous" integrity="sha384-vyLW6Bx7CSO60lXvtriJdOzEZcUgh+l5TLYEkYFo98av5UWOrBfTY+sFvkepcVho" type="text/javascript"></script><script src="https://ok12static.oktacdn.com/assets/js/saasure.nojquery.min.4e499154040d1c3af6b4c14db61775be.js" crossorigin="anonymous" integrity="sha384-sJXlBL4BfT8B1lLhhVRg8phjLN1Fegy/3LcykToibwAcSrHt38x1/LowA8I+4ZO3" type="text/javascript"></script><!--[if lt IE 9]><script src="https://ok12static.oktacdn.com/assets/enduser/js/vendor/css3-mediaqueries.fa295f0132f5335f352071ca3613a94a.js" crossorigin="anonymous" integrity="sha384-7pU2GSgyec3nzQMUNSuzanfJelP9UCOyHil0bOv+WnPKSS9lNA/tcxPyr7NV2w6c" type="text/javascript"></script><![endif]-->

```

### Javascript is disabled on your browser.

Please enable Javascript and refresh this page to use Okta.

null

```
                    </div>
            </div>

            </div>

    <!--[if gte IE 8]>

```

\<![if lte IE 10]\>

```
<style>
.unsupported-browser-banner-wrap {
  padding: 20px;
  border: 1px solid #ddd;
  background-color: #f3fbff;
}
.unsupported-browser-banner-inner {
  position: relative;
  width: 735px;
  margin: 0 auto;
  text-align: left;
}
.unsupported-browser-banner-inner .icon {
  vertical-align: text-bottom;
  margin-right: 5px;
  display: inline-block;
  position: static !important;
}
.unsupported-browser-banner-inner a {
  text-decoration: underline;
}
</style>

<div class="unsupported-browser-banner-wrap">
  <div class="unsupported-browser-banner-inner">
    <span class="icon icon-16 icon-only warning-16-yellow"></span>You are using an unsupported browser. For the best experience, update to <a href="https://support.okta.com/help/s/article/Okta-Browser-and-OS-Support-Policy">a supported browser</a>.</div>
</div>

```

\<![endif]\>  
\<![endif]–\>

404

 ![404: Page Not Found](https://ok12static.oktacdn.com/assets/img/ui/http-error-404.e21dc7337e238d67a501b4bd3d3c1f42.png)

Page Not Found

# We couldn't find the page you were looking for.

Go to Homepage

NONE

---

<div class="post-metadata">

**Author:** ![Cale](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/cale/32/2496_2.png) [@Cale](https://devforum.okta.com/u/Cale)\
**Post date:** [February 22, 2021, 2:45pm UTC](https://devforum.okta.com/t/getting-response-404-for-oidc-logout-api-call/13020/2 "2021-02-22T14:45:11Z")

</div>

Hi there. Can you verify in your network tab that the format of your /logout call matches this?

`GET https://{baseUrl}/logout?id_token_hint=${id_token}&post_logout_redirect_uri=${post_logout_redirect_uri}`

More info here: [Single Logout in applications | Okta](https://help.okta.com/en/prod/Content/Topics/Apps/Apps_Single_Logout.htm)

---

<div class="post-metadata">

**Author:** ![balamurali.k](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@balamurali.k](https://devforum.okta.com/u/balamurali.k)\
**Post date:** [February 22, 2021, 2:49pm UTC](https://devforum.okta.com/t/getting-response-404-for-oidc-logout-api-call/13020/3 "2021-02-22T14:49:31Z")

</div>

> [@Cale](#):
>
> format

I am not sending the values for state and post\_logout\_redirect\_uri as these 2 are optional, please let me know cale if i need to pass values for both of them ?

---

<div class="post-metadata">

**Author:** ![Cale](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/cale/32/2496_2.png) [@Cale](https://devforum.okta.com/u/Cale)\
**Post date:** [February 22, 2021, 3:13pm UTC](https://devforum.okta.com/t/getting-response-404-for-oidc-logout-api-call/13020/4 "2021-02-22T15:13:52Z")

</div>

You are correct about those parameters being optional. If you are formatting it with `/logout?id_token_hint=<id_token>` then my guess is you are not sending the request to the auth server that granted the token.

Can you make sure your logout call is going to either

`https://{youroktadomain}/oauth2/v1/logout`

or

`https://{youroktadomain}/oauth2/default/v1/logout`

Or for option 2 - if you used another custom auth server instead of default.

The call should be made to the auth server that granted the token.

---

<div class="post-metadata">

**Author:** ![balamurali.k](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@balamurali.k](https://devforum.okta.com/u/balamurali.k)\
**Post date:** [February 23, 2021, 12:25pm UTC](https://devforum.okta.com/t/getting-response-404-for-oidc-logout-api-call/13020/5 "2021-02-23T12:25:47Z")

</div>

I am getting as below, do we need to certainly allow cookies for logout functionality ?

Any other alternative rather than allowing cookies ?

========================================================================

# Javascript is disabled on your browser.&nbspPlease enable Javascript and refresh this page.

Refresh

## Your OneDrive version is not supported

Upgrade now by installing the OneDrive for Business Next Generation Sync Client to login to Okta

[Learn how to upgrade](https://support.okta.com/help/articles/Knowledge_Article/Upgrading-to-OneDrive-for-Business-Next-Generation-Sync-Client)

## Cookies are required

Cookies are disabled on your browser. Please enable Cookies and refresh this page.

Refresh

Powered by [Okta](http://www.okta.com/)

[Privacy Policy](https://devforum.okta.com/privacy)

---

<div class="post-metadata">

**Author:** ![Cale](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/cale/32/2496_2.png) [@Cale](https://devforum.okta.com/u/Cale)\
**Post date:** [February 23, 2021, 6:36pm UTC](https://devforum.okta.com/t/getting-response-404-for-oidc-logout-api-call/13020/6 "2021-02-23T18:36:33Z")

</div>

Well technically if you aren’t allowing ANY cookies then there’s no session to logout from =).

Keep in mind, calls to /logout do not revoke the id token passed in the hint - it kills the `sid` session cookie that is created when you login to Okta. If you are relying solely on tokens for a user’s session in your application, then you will need to manually clear the ID token out of wherever you have it stored locally.

---

<div class="post-metadata">

**Author:** ![lingpri1](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/lingpri1/32/3605_2.png) [@lingpri1](https://devforum.okta.com/u/lingpri1)\
**Post date:** [January 22, 2022, 5:06pm UTC](https://devforum.okta.com/t/getting-response-404-for-oidc-logout-api-call/13020/7 "2022-01-22T17:06:15Z")

</div>

I’m facing a similar problem , as mentioned in this thread. I grabbed the session token to pass it in the state parameter . Step 1 is to post a curl request to authn server, Step 2: is to post to authorize server  
and to get the **code** and **state** back.However I’m getting javascript is not enabled in your browser , please enable javascript and try again. Perhaps, I’m wondering if I should post a curl request again from the terminal, to circumvent this issue. Redirect URI and the state value is posted in present in the global variables. Is this an postman issue ?

```auto
curl -v -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
  "username": " ******",
  "password": " *******",
  "options": {
    "multiOptionalFactorEnroll": false,
    "warnBeforePasswordExpired": false
  }
}' "https://domain/api/v1/authn"

```

**step2:**  
{{url}}/oauth2/v1/authorize?client\_id={{clientId}}&response\_type=code&response\_mode=form\_post&scope={{scopes}}&redirect\_uri={{redirectUri}}&state={{state}}

_ **yet another URL: Custom Authorization Server** _  
{{url}}/oauth2//v1/authorize?client\_id={{clientId}}&response\_type=code&response\_mode=form\_post&scope={{scopes}}&redirect\_uri=http://localhost:8080&state=

 ![global parameters 2](https://global.discourse-cdn.com/oktadev/original/2X/2/2cc47f50e4f4b9a0f1aa4779533e65c859c9c469.png)

 ![okta_postman_console](https://global.discourse-cdn.com/oktadev/original/2X/0/0b9c29246aa7a112663c60befe8217aa59da0766.png)

![javascript_is_disabled](https://global.discourse-cdn.com/oktadev/original/2X/5/5b5f0a7bcf73db131d7e1cd6e61a28c2042e58b1.png)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [February 8, 2024, 9:23pm UTC](https://devforum.okta.com/t/getting-response-404-for-oidc-logout-api-call/13020/8 "2024-02-08T21:23:55Z")

</div>

Closed on February 8, 2024, 9:23pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
