API

socialauth

socialauth.http_get_provider(provider, request_url, params, token_secret, token_cookie=None)[source]

Handle HTTP GET requests on an authentication endpoint.

Authentication flow begins when params has a login key with a value of start. For instance, /auth/twitter?login=start.

Parameters:
  • provider (str) – An provider to obtain a user ID from.
  • request_url (str) – The authentication endpoint/callback.
  • params (dict) – GET parameters from the query string.
  • token_secret (str) – An app secret to encode/decode JSON web tokens.
  • token_cookie (str) – The current JSON web token, if available.
Returns:

A dict containing any of the following possible keys:

status: an HTTP status code the server should sent

redirect: where the client should be directed to continue the flow

set_token_cookie: contains a JSON web token and should be stored by the client and passed in the next call.

provider_user_id: the user ID from the login provider

provider_user_name: the user name from the login provider