Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292776

cant logout via REST: logout message: "'csrf_token' URL query argument is invalid."

$
0
0

Problem/Motivation

I am trying to logout from a drupal session and I cant find any official documentation to explain how to do it.

I have referred to the official docs and there are lots of different discussions all proposing different ways of doing it with mixed results The official docs appear to be missing the csrf_token somewhere in the input which is Drupal is asking for on execution.

Trying to piece together different discussions to include it my latest attempt is:

```
https://mysite.com/user/logout?_format=json&token={{logout_token_from_login_result}}
```

with a header

```
"Content-Type": "application/vnd.api+json",
"X-CSRF-Token": csrf_token_from_login_result
```

The result is:

```
{message: "'csrf_token' URL query argument is invalid."}
```

with watchdog message:
```
Type access denied
Date Monday, January 24, 2022 - 13:00
User Anonymous (not verified)
Location http://mysite.com/user/logout?_format=json&token=TBiM6p-x9GdSuFnLYoEgxzV...
Referrer https://mysite.com/
Message Path: /user/logout?_format=json&token=TBiM6p-x9GdSuFnLYoEgxzVsHYYph4bAmVI0J9iuK2w. Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException: 'csrf_token' URL query argument is invalid. in Drupal\Core\Routing\AccessAwareRouter->checkAccess() (line 121 of /var/www/html/web/core/lib/Drupal/Core/Routing/AccessAwareRouter.php).
Severity Warning
Hostname 172.28.2.1
Operations
```

which doesnt make sense as there is no csrf_token URL argument.

any guidance is much appreciated.

Steps to reproduce

see above

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 292776

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>