authentication methods module¶
-
asynctmdb.methods.authentication.
create_request_token
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, session: aiohttp.client.ClientSession, date_time_format: str = '%Y-%m-%d %H:%M:%S %Z') → typing.Dict[str, typing.Union[int, str, datetime.datetime]][source]¶ Create a temporary request token that can be used to validate a TMDb user login.
More details about how this works can be found here.
More info at TMDb docs.
-
asynctmdb.methods.authentication.
create_session
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, request_token: str, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Union[int, str]][source]¶ Create a fully valid session.
This method can be used once a user has validated the request token.
More details about how this works can be found here.
More info at TMDb docs.
-
asynctmdb.methods.authentication.
validate_request_token
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, username: str, password: str, request_token: str, session: aiohttp.client.ClientSession) → typing.Dict[str, typing.Union[int, str]][source]¶ Validate a request token with username and password.
Caution
Please note, using this method is strongly discouraged.
The preferred method of validating a request token is to have a user authenticate the request via the TMDb website.
More details about how this works can be found here.
More info at TMDb docs.
-
asynctmdb.methods.authentication.
create_guest_session
(*, api_base_url: str = 'https://api.themoviedb.org/3', api_key: str, session: aiohttp.client.ClientSession, date_time_format: str = '%Y-%m-%d %H:%M:%S %Z') → typing.Dict[str, typing.Union[int, str, datetime.datetime]][source]¶ Create a new guest session.
Guest sessions are a type of session that will let a user rate movies and TV shows but not require them to have a TMDb user account.
More information about user authentication can be found here.
Please note, there should be generated only a single guest session per user (or device) as you will be able to attach the ratings to a TMDb user account in the future.
There is also IP limits in place so you should always make sure it’s the end user doing the guest session actions.
If a guest session is not used for the first time within 24 hours, it will be automatically deleted.
More info at TMDb docs.