Generate login cookie in shell (using curl?)

三世轮回 提交于 2021-01-29 07:30:46

问题


I would like to generate a login cookie in the shell, before launching my browser, such that I am already logged into certain websites. Currently I am trying this with my own nextcloud server using the following command

curl --cookie test.txt --cookie-jar test.txt \
-d "user=***name***" \
-d "password=***password***" \
<my nextcloud server>/index.php/login 

getting a cookie that looks like the following. However, placing this among my other cookies does not allow me to login.

# Netscape HTTP Cookie File
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

#HttpOnly_<my nextcloud server>  FALSE   /nextcloud      TRUE       nc_sameSiteCookiestrict        true
#HttpOnly_<my nextcloud server>  FALSE   /nextcloud      TRUE          nc_sameSiteCookielax   true
#HttpOnly_<my nextcloud server>  FALSE   /nextcloud      TRUE          oc_sessionPassphrase  .....
#HttpOnly_<my nextcloud server> FALSE   /nextcloud      TRUE         ..... ...................

Recording with chromium the action of a normal login, a different cookie is generated out of the one below, is anyone familiar with this login method? Thanks!

My goal would be an auto login script like this one for the surf browser

来源:https://stackoverflow.com/questions/64704263/generate-login-cookie-in-shell-using-curl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!