.Net MVC example Logout causes error

I tried executing code for the .NET MVC login example from here: https://github.com/oktadeveloper/okta-aspnet-mvc-example.

Login is working fine.But when i click on logout i am getting 400 Bad request - The id token is invalid.

The PostLogoutRedirectUri is “http://localhost:8080/Account/PostLogout” as it was in your sample.I have made no change here.Also i have updated the same in my Okta account.

My Okta account - application setting is

Fixed. As i made a mistake in the id token.

Apologies!

Hello Diya,

How did you managed to fixed this?

Hi @mdighe10

The error usually occurs if the ID token sent to the /logout endpoint of the authorization server is incorrect or if it was issued for a different authorization server. You can find here the documentation describing the process.

If you still encounter an issue, please open a support ticket with us by sending an email to developers@okta.com and one of our Developer Support Engineers will further assist you.

1 Like

Same issue here. I have an asp.net web site and when the user logs out/redirected to okta, “invalid id token” error is received.

Is there a current doc/example that displays how this would work with an asp.net web site, and one that’s not mvc, not a web application, not a .net core project, etc.?

Ive followed the example below:

However, I receive the “invalid id token” error when logging out.

I’m more than happy to post my startup code if need be.

Thanks in advance!

1 Like

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