vim-http icon indicating copy to clipboard operation
vim-http copied to clipboard

Support cookie authentication

Open digitaico opened this issue 3 years ago • 1 comments

Hi, great plugin, thanks. I want to know how can it support sending a cookie, let's say a JWT. I don't need manual auth, just pass the token. Thanks,

digitaico avatar Nov 23 '22 20:11 digitaico

Hey @digitaico

In that case I would just add the header directly:

GET /foobar HTTP/1.1
Cookie: PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1

if you have a jwt say for OAuth you can do something similar:

GET /foobar HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c```

nicwest avatar Mar 09 '23 10:03 nicwest