CSRF validation failed issue on custom services!
You can check workflow steps

First Time for login


POST /services/session/token to retrieve CSRF Token POST
myendpoint/system/connect with X-CSRF-Token header IF not Logged In
Try Log in /myendpoint/user/login Log in Success and keep
session_name=sessionid in Cookie Varible


Future Launches


POST /services/session/token to retrieve CSRF Token
POST myendpoint/system/connect with X-CSRF-Token header along with previousely saved session_name=sessionid as Cookie Header


Don't request for new CSRF token use the returned one for previous request.
You will find it in a key named token in the result returned.
Just request a new csrfCSRF token for the first time only.

Here is an example of a user profile request: 

{
  "method": "POST",
  "url": "http://HOSTNAME/SERVICE_PATH/user/profile",
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Connection": "keep-alive",
    "X-CSRF-Token": "MHT4hmagxHgf0lOYlkENGlTZGk2AZ96G3p3ZCCc2kvo",
    "Cookie": "SESSb4d5ba755bb4eb727d982993490e6681=waroHcB4h8rbU0yhZjh-zGLAquZYlpayC_kB38gx--I"
  }
}