REST server: 400 bad request with DELETE /session/my
Concerned version
Version: %2.0.X
Platform: All
Summary
Try to delete current session. '400 Bad request' is returned by Portal.
Logs
(DevOps-redirection *=)$ curl -H "Accept: application/json" -d user=dwho -d password=dwho http://auth.example.com:19876
{"result":1,"id":"2ed46599ec9c351007c76404a5c292569146f58cbbc7eb4d20059ff77ee99ed6","error":"0"}
curl -H "Accept: application/json" -H "cookie: lemonldap=2ed46599ec9c351007c76404a5c292569146f58cbbc7eb4d20059ff77ee99ed6" http://auth.example.com:19876/session/my/global
{"_session_kind":"SSO","_utime":1643205886,"groups":"timelords; users","authenticationLevel":1,"_session_id":"2ed46599ec9c351007c76404a5c292569146f58cbbc7eb4d20059ff77ee99ed6","_startTime":"20220126150446","UA":"curl/7.68.0","_lastSeen":null,"ipAddr":"127.0.0.1","_whatToTrace":"dwho"}
curl -X DELETE -H "Accept: application/json" -H "cookie: lemonldap=2ed46599ec9c351007c76404a5c292569146f58cbbc7eb4d20059ff77ee99ed6" http://auth.example.com:19876/session/my
{"error":"Bad request"}
Jan 26 15:05:19 localhost LLNG[12052]: [debug] Start routing session
Jan 26 15:05:19 localhost LLNG[12052]: [debug] Request to get exported attributes -> Keys: groups, _utime, _session_kind, _session_id, _startTime, authenticationLevel, _lastSeen, UA, _whatToTrace, ipAddr
Jan 26 15:05:19 localhost LLNG[12052]: [debug] Get session 2ed46599ec9c351007c76404a5c292569146f58cbbc7eb4d20059ff77ee99ed6 from Common::Session::REST
Jan 26 15:05:19 localhost LLNG[12052]: [debug] Apply following CORS policy :
Jan 26 15:05:19 localhost LLNG[12052]: [debug] Access-Control-Allow-Origin
Jan 26 15:05:19 localhost LLNG[12052]: [debug] *
Jan 26 15:05:19 localhost LLNG[12052]: [debug] Access-Control-Allow-Credentials
Jan 26 15:05:19 localhost LLNG[12052]: [debug] true
Jan 26 15:05:19 localhost LLNG[12052]: [debug] Access-Control-Allow-Headers
Jan 26 15:05:19 localhost LLNG[12052]: [debug] *
Jan 26 15:05:19 localhost LLNG[12052]: [debug] Access-Control-Allow-Methods
Jan 26 15:05:19 localhost LLNG[12052]: [debug] POST,GET
Jan 26 15:05:19 localhost LLNG[12052]: [debug] Access-Control-Expose-Headers
Jan 26 15:05:19 localhost LLNG[12052]: [debug] *
Jan 26 15:05:19 localhost LLNG[12052]: [debug] Access-Control-Max-Age
Jan 26 15:05:19 localhost LLNG[12052]: [debug] 86400
Jan 26 15:05:53 localhost LLNG[12053]: [debug] Start routing session
Jan 26 15:05:53 localhost LLNG[12053]: [debug] Returned userId: dwho
Jan 26 15:05:53 localhost LLNG[12053]: [debug] [warn] [dwho] Bad request
Jan 26 15:05:53 localhost LLNG[12053]: [notice] Error 400: Bad request
Jan 26 15:05:53 localhost LLNG[12053]: [debug] Apply following CORS policy :
Jan 26 15:05:53 localhost LLNG[12053]: [debug] Access-Control-Allow-Origin
Jan 26 15:05:53 localhost LLNG[12053]: [debug] *
Backends used
Demo