python-harborclient icon indicating copy to clipboard operation
python-harborclient copied to clipboard

harbor command failed, get error message "CSRF token invalid", why?

Open zhwwzh opened this issue 5 years ago • 0 comments

harbor --debug --os-baseurl https://harbor01.wcloud.net --os-username admin --os-cacert /data/cert/ca.crt --os-project 1 info

password: DEBUG (connectionpool:943) Starting new HTTPS connection (1): harbor01.wcloud.net:443 DEBUG (connectionpool:442) https://harbor01.wcloud.net:443 "POST /c/login HTTP/1.1" 403 65 CommandError: Unable to authorize user 'admin': {"reason": "Forbidden", "message": "{"errors":[{"code":"FORBIDDEN","message":"CSRF token invalid"}]} "}

harbor --debug --os-baseurl https://harbor01.wcloud.net --os-username admin --insecure --os-project 1 info

password: DEBUG (connectionpool:943) Starting new HTTPS connection (1): harbor01.wcloud.net:443 DEBUG (connectionpool:442) https://harbor01.wcloud.net:443 "POST /c/login HTTP/1.1" 403 65 CommandError: Unable to authorize user 'admin': {"reason": "Forbidden", "message": "{"errors":[{"code":"FORBIDDEN","message":"CSRF token invalid"}]} "}

###python-harborclient version###

harbor --version

1.2.3

###harbor version### Harbor V2.0.2

zhwwzh avatar Sep 01 '20 16:09 zhwwzh