AuthHandler class --- Twitcasting API Authentication

Authentication header

AuthHandler

class twitcaspy.auth.auth.AuthHandler(client_id, client_secret)

AuthHandler Base Class

パラメータ
  • client_id (str) -- このアプリケーションのclient_id

  • client_secret (str) -- このアプリケーションのclient_secret

例外

TypeError -- client id または secret が string インスタンスではないとき

Application-only authentication handler

class twitcaspy.auth.AppAuthHandler(client_id, client_secret)

ベースクラス: twitcaspy.auth.auth.AuthHandler

Application-only authentication handler

パラメータ
  • client_id (str) -- このアプリケーションのclient_id

  • client_secret (str) -- このアプリケーションのclient_secret

参照

https://apiv2-doc.twitcasting.tv/#access-token

Authorization Code Grant handler

class twitcaspy.auth.GrantAuthHandler(client_id, client_secret, callback=None, *, state=None)

ベースクラス: twitcaspy.auth.auth.AuthHandler

Authorization Code Grant handler

パラメータ
  • client_id (str) -- このアプリケーションのclient_id

  • client_secret (str) -- このアプリケーションのclient_secret

  • callback (str) -- リダイレクトURI(アプリケーション登録時に設定したCallback URLと同一のものを指定)

  • state (str) -- 任意のCSRFトークン

参照

https://apiv2-doc.twitcasting.tv/#authorization-code-grant

get_authorization_url()

ユーザー認証のためのリダイレクトURLを取得します

Implicit handler

class twitcaspy.auth.ImplicitAuthHandler(client_id, client_secret, callback=None, *, state=None)

ベースクラス: twitcaspy.auth.auth.AuthHandler

Implicit Code Grant handler

パラメータ
  • client_id (str) -- このアプリケーションのclient_id

  • client_secret (str) -- このアプリケーションのclient_secret

  • callback (str) -- リダイレクトURI(アプリケーション登録時に設定したCallback URLと同一のものを指定)

  • state (str) -- 任意のCSRFトークン

参照

https://apiv2-doc.twitcasting.tv/#implicit

get_authorization_url()

ユーザー認証のためのリダイレクトURLを取得します

OAuth2

Basic認証

class twitcaspy.auth.oauth.OAuth2Basic(client_id, client_secret)

ベースクラス: requests.auth.AuthBase

Basic認証

パラメータ
  • client_id (str) -- このアプリケーションのclient_id

  • client_secret (str) -- このアプリケーションのclient_secret

例外

TypeError -- client id または secret が string インスタンスではないとき

Bearer認証

class twitcaspy.auth.oauth.OAuth2Bearer(bearer_token)

ベースクラス: requests.auth.AuthBase

Bearer認証

パラメータ

bearer_token (str) -- Bearerトークン

例外

TypeError -- bearer_tokenが string インスタンスではないとき