The authorization process
Authorization on Sankaku Complex can be performed in two ways:
- via access token
- via credentials (login and password)
Note
It is not necessary to login into Sankaku Complex at all. You are free to send requests to server as unauthorized user, but in that case some methods will be unavailable to you (e.g.
get_favorited_posts()
,get_favorited_books()
etc.).
Authorization via access token
The following code block shows how to login into account using access token:
Authorization via credentials
Authorization method by credentials is the same as in previous example,
but now user should pass two arguments to login()
method:
Results
If authorization was successful, server will return response with serialized
json data which will be processed by pydantic. After that user profile model
will be passed to client.profile
and all further requests to Sankaku servers
will be performed on behalf of logged-in user.