# CORS issue on logout

**URL:** <https://devforum.okta.com/t/cors-issue-on-logout/19727>\
**Category:** OAuth/OIDC\
**Tags:** api, dotnet, angular\
**Created:** [March 8, 2022, 2:27pm UTC](https://devforum.okta.com/t/cors-issue-on-logout/19727 "2022-03-08T14:27:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shripadgodse](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@shripadgodse](https://devforum.okta.com/u/shripadgodse)\
**Post date:** [March 8, 2022, 2:27pm UTC](https://devforum.okta.com/t/cors-issue-on-logout/19727/1 "2022-03-08T14:27:42Z")

</div>

Hello there,  
I have application build in .Net Core as rest api as backend technology and Angular 7 as client side, wherein i have implemented Okta using OpenIdConnect for SSO. I am able to login into application by returning ChallengeResult, though facing CORS issue while signing out of the application. Below is the screenshot in which you can see the end point used for signing out the user.

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/2/255daa6a2689217c27d44e140e942e98fd484ae0.png)

Also i have attached the CORS configuration added for the application.

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/c/cbefaf120ab492fed9e3390da065d822c342a3ef.png)

And below is the problem i get in network tab if used signout end point.

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/c/cc7eed0f07261b0813a4e9c6800fcbe5ea4b8745.png)

Hope someone could help me in the same.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [March 8, 2022, 4:19pm UTC](https://devforum.okta.com/t/cors-issue-on-logout/19727/2 "2022-03-08T16:19:06Z")

</div>

The [/logout endpoint](https://developer.okta.com/docs/reference/api/oidc/#logout) does _not_ support CORS. You must redirect the browser to this endpoint to complete logout.

---

<div class="post-metadata">

**Author:** ![shripadgodse](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@shripadgodse](https://devforum.okta.com/u/shripadgodse)\
**Post date:** [March 9, 2022, 6:43am UTC](https://devforum.okta.com/t/cors-issue-on-logout/19727/3 "2022-03-09T06:43:15Z")

</div>

@andrea Thanks for the quick response, though i think we are trying to do the same. You can see my singOut method in first screenshot. I have another sample application buil in .Net core web app and it seems working fine, the only difference i can see in URL after return SingoutResult is i cannot see id\_token\_hint in my original applications request.

[https://dev-37072078.okta.com/oauth2/v1/logout?post\_logout\_redirect\_uri=https://localhost:44339/signout-callback-oidc&state=CfDJ8EaoT66VSRtHvLfbCKwZHB0TAPu75P2LqM14hJKRjHizGI4GTvFkpRERTf5-JGBAbF5ovEN4IBBVPn8UwGj2s682BWNm7wTI-qfgrvkEvATn9xeGV1Kx0FAL9U8GJjWpajbBlgMVlkSms4FhNm49alU&x-client-SKU=ID\_NETSTANDARD2\_0&x-client-ver=5.6.0.0](https://dev-37072078.okta.com/oauth2/v1/logout?post_logout_redirect_uri=https://localhost:44339/signout-callback-oidc&state=CfDJ8EaoT66VSRtHvLfbCKwZHB0TAPu75P2LqM14hJKRjHizGI4GTvFkpRERTf5-JGBAbF5ovEN4IBBVPn8UwGj2s682BWNm7wTI-qfgrvkEvATn9xeGV1Kx0FAL9U8GJjWpajbBlgMVlkSms4FhNm49alU&x-client-SKU=ID_NETSTANDARD2_0&x-client-ver=5.6.0.0)

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [March 9, 2022, 4:39pm UTC](https://devforum.okta.com/t/cors-issue-on-logout/19727/4 "2022-03-09T16:39:20Z")

</div>

If the id\_token\_hint is not getting passed to the /logout endpoint, logout will not work. This must be present to end the user’s session in Okta.

---

<div class="post-metadata">

**Author:** ![shripadgodse](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@shripadgodse](https://devforum.okta.com/u/shripadgodse)\
**Post date:** [March 10, 2022, 9:20am UTC](https://devforum.okta.com/t/cors-issue-on-logout/19727/5 "2022-03-10T09:20:46Z")

</div>

Thank you very much. As i am getting CORS issue on returning SignoutResult, i will create url dynamically and change current url to logout url on click of logout. Hope logout URL for Okta won’t change that often.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [March 10, 2022, 7:28pm UTC](https://devforum.okta.com/t/cors-issue-on-logout/19727/6 "2022-03-10T19:28:15Z")

</div>

It shouldn’t, but if you’re ever unsure of the /logout url, you can find all the OIDC endpoints for your auth server by going to the [well-known endpoint](https://developer.okta.com/docs/reference/api/oidc/#well-known-openid-configuration): issuer/.well-known/openid-configuration

---

<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:** [March 11, 2022, 7:28pm UTC](https://devforum.okta.com/t/cors-issue-on-logout/19727/7 "2022-03-11T19:28:58Z")

</div>

Closed on March 11, 2022, 7:28pm UTC

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