Merge pull request #793 from gpodder/remove-advertise
[mygpo.git] / doc / api / reference / auth.rst
blob609a62a1ee1fb4b880c1c43ade87450e66133651
1 Authentication API
2 ==================
4 Login / Verify Login
5 --------------------
7 ..  http:post:: /api/2/auth/(username)/login.json
8     :synopsis: verify the login status
10     * since 2.10
12     Log in the given user for the given device via HTTP Basic Auth.
14     :param username: the username which should be logged in
15     :status 401: If the URL is accessed without login credentials provided
16     :status 400: If the client provides a cookie, but for a different username than the one given
17     :status 200: the response headers have a ``sessionid`` cookie set.
19     The client can use this URL with the cookie in the request header to check
20     if the cookie is still valid.
23 Logout
24 ------
26 ..  http:post:: /api/2/auth/(username)/logout.json
27     :synopsis: logout
29     * since 2.10
31     Log out the given user. Removes the session ID from the database.
33     :param username: the username which should be logged out
34     :status 200: if the client didn't send a cookie, or the user was
35                  successfully logged out
36     :status 400: if the client provides a cookie, but for a different username than the one given