Authentication
Bases: TMDB
Authentication functionality.
https://developers.themoviedb.org/3/authentication
https://www.themoviedb.org/documentation/api/sessions
Source code in src/tmdb_client_py/account.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | |
guest_session_new(**kwargs)
This method will let you 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 (https://developers.themoviedb.org/3/authentication/how-do-i-generate-a-session-id).
Please note, you should only generate 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.
Args:
Returns:
| Type | Description |
|---|---|
|
A dict representation of the JSON returned from the API. |
Source code in src/tmdb_client_py/account.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | |
session_delete(**kwargs)
If you would like to delete (or "logout") from a session, call this method with a valid session ID.
Args:
Returns:
| Type | Description |
|---|---|
|
A dict representation of the JSON returned from the API. |
Source code in src/tmdb_client_py/account.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | |
session_new(**kwargs)
You can use this method to create a fully valid session ID once a user has validated the request token. More information about how this works can be found here (https://developers.themoviedb.org/3/authentication/how-do-i-generate-a-session-id).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_token
|
The token you generated for the user to approve. The token needs to be approved before being used here. |
required |
Returns:
| Type | Description |
|---|---|
|
A dict representation of the JSON returned from the API. |
Source code in src/tmdb_client_py/account.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | |
token_new(**kwargs)
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 (https://developers.themoviedb.org/3/authentication/how-do-i-generate-a-session-id).
Args:
Returns:
| Type | Description |
|---|---|
|
A dict representation of the JSON returned from the API. |
Source code in src/tmdb_client_py/account.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | |
token_validate_with_login(**kwargs)
This method allows an application to validate a request token by entering a username and password.
Not all applications have access to a web view so this can be used as a substitute.
Please note, the preferred method of validating a request token is to have a user authenticate the request via the TMDb website. You can read about that method here (https://developers.themoviedb.org/3/authentication/how-do-i-generate-a-session-id).
If you decide to use this method please use HTTPS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
username
|
The user's username on TMDb. |
required | |
password
|
The user's password on TMDb. |
required | |
request_token
|
The token you generated for the user to approve. |
required |
Returns:
| Type | Description |
|---|---|
|
A dict representation of the JSON returned from the API. |
Source code in src/tmdb_client_py/account.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | |