From c49364fcc4981eee500dcde34f2e494fdd15ff96 Mon Sep 17 00:00:00 2001 From: halcy Date: Mon, 28 Nov 2022 01:31:04 +0200 Subject: Some more doc split tests --- docs/04_auth.rst | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 docs/04_auth.rst (limited to 'docs/04_auth.rst') diff --git a/docs/04_auth.rst b/docs/04_auth.rst new file mode 100644 index 0000000..454d6a2 --- /dev/null +++ b/docs/04_auth.rst @@ -0,0 +1,36 @@ +App registration and user authentication +======================================== + +Before you can use the Mastodon API, you have to register your +application (which gets you a client key and client secret) +and then log in (which gets you an access token) and out (revoking +the access token you are logged in with). These functions +allow you to do those things. Additionally, it is also possible +to programmatically register a new user. + +For convenience, once you have a client id, secret and access token, +you can simply pass them to the constructor of the class, too! + +Note that while it is perfectly reasonable to log back in whenever +your app starts, registering a new application on every +startup is not, so don't do that - instead, register an application +once, and then persist your client id and secret. A convenient method +for this is provided by the functions dealing with registering the app, +logging in and the Mastodon classes constructor. + +To talk to an instance different from the flagship instance, specify +the api_base_url (usually, just the URL of the instance, i.e. +https://mastodon.social/ for the flagship instance). If no protocol +is specified, Mastodon.py defaults to https. + +.. automethod:: Mastodon.create_app +.. automethod:: Mastodon.__init__ +.. _log_in(): +.. automethod:: Mastodon.log_in +.. _auth_request_url(): +.. automethod:: Mastodon.auth_request_url +.. _set_language(): +.. automethod:: Mastodon.set_language +.. automethod:: Mastodon.revoke_access_token +.. automethod:: Mastodon.create_account +.. automethod:: Mastodon.email_resend_confirmation -- cgit v1.2.3