Asp.Net OpenID Logout Issues




I’m trying to implement logout in my Asp.Net application. My code is based on quick start from here:

When I initiate Okta logout I’m geting next issues:

  1. Okta API /logout endpoint does not support CORS so browser blocks any requests.
  2. After adding CORS plugin to Chrome I’m getting “Not found: Resource not found” expection in response (I can see it in browser console). However I can delete current session using RESTED plugin (DELETE

Please help, thanks in advance.


Normal OpenID Connect Flow does not work because CORS is not supported.
To delete current session I have to use /api/v1/sessions/me endpoint (CORS supported).
Client side script looks like:
url: ‘https://dev-{yourId}’,
type: ‘DELETE’,
xhrFields: { withCredentials: true },
success: function(result) {

The problem was that cookies were not attached to the request. “xhrFields: { withCredentials: true }” solved the issue.


Assuming your application is set up like the example you linked to, you should log out by calling:


This does two things:

  • Delete the aspnet cookie that is keeping track of the local session
  • Redirects to Okta to delete the user’s session in Okta

Okta will redirect back to your app on the PostLogoutRedirectUri you set in Startup.cs.