Is it possible?

Thanks for your help.
However, My boss wants it.
Please check my perform.
I tried to perform with Discourse API like this

  1. call GET ‘/session/csrf’ and get csrf token and cookie
  2. call POST ‘/session’ with Header:‘X-CSRF-Token’=‘csrf token’, ‘Cookie’ = ‘obtained cookie’, Data: login, password, timezone, second-factor-method,authenticity-token
  3. call POST ‘/login’ with Header: ‘Cookie’=‘obtained cookie from /session’
    Data: username, password, redirect

All logs are same with Discourse Login workflow.
But when I redirect to discourse forum, user didn’t log in.

How can I solve this issue? What wrong?

Thanks for your help again.

PS. My Server is Ubuntu Nginx Server.