aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'docs/04_auth.rst')
-rw-r--r--docs/04_auth.rst36
1 files changed, 36 insertions, 0 deletions
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 @@
1App registration and user authentication
2========================================
3
4Before you can use the Mastodon API, you have to register your
5application (which gets you a client key and client secret)
6and then log in (which gets you an access token) and out (revoking
7the access token you are logged in with). These functions
8allow you to do those things. Additionally, it is also possible
9to programmatically register a new user.
10
11For convenience, once you have a client id, secret and access token,
12you can simply pass them to the constructor of the class, too!
13
14Note that while it is perfectly reasonable to log back in whenever
15your app starts, registering a new application on every
16startup is not, so don't do that - instead, register an application
17once, and then persist your client id and secret. A convenient method
18for this is provided by the functions dealing with registering the app,
19logging in and the Mastodon classes constructor.
20
21To talk to an instance different from the flagship instance, specify
22the api_base_url (usually, just the URL of the instance, i.e.
23https://mastodon.social/ for the flagship instance). If no protocol
24is specified, Mastodon.py defaults to https.
25
26.. automethod:: Mastodon.create_app
27.. automethod:: Mastodon.__init__
28.. _log_in():
29.. automethod:: Mastodon.log_in
30.. _auth_request_url():
31.. automethod:: Mastodon.auth_request_url
32.. _set_language():
33.. automethod:: Mastodon.set_language
34.. automethod:: Mastodon.revoke_access_token
35.. automethod:: Mastodon.create_account
36.. automethod:: Mastodon.email_resend_confirmation
Powered by cgit v1.2.3 (git 2.41.0)