bepasty-server icon indicating copy to clipboard operation
bepasty-server copied to clipboard

Pass login token in API requests

Open chrisliebaer opened this issue 4 years ago • 2 comments

This might be an extremely embarrassing question if I'm wrong but I was unable to find a way to pass a login token along API requests. I would have expected there to be a header field that I can use but the documentation doesn't seem to mention anything. I don't have a lot of experience with Python but looking at the code, it seems like the login status is entirely cookie based?

If that's the case then I would like to propose a header field that can be used by API requests to include the login token without having to store cookies.

chrisliebaer avatar Mar 20 '21 08:03 chrisliebaer

IIRC, the bepasty-server code currently assumes that a cookie-based session is established.

For a interactive, browser-based session, this is fine.

For automated stuff, you could have a look at how the cli interface deals with this: https://github.com/bepasty/bepasty-client-cli

ThomasWaldmann avatar Apr 05 '21 14:04 ThomasWaldmann

docs about how to use http basic auth: https://github.com/bepasty/bepasty-server/pull/273/files

ThomasWaldmann avatar May 13 '21 06:05 ThomasWaldmann