OAuth

oauth.request_token(server_url, *args, **kwargs)

Returns resource owner key and secret for given consumer key and secret.

Accepts the same parameters as requests.post() except url.

Implements https://twitter-api.readthedocs.io/en/latest/oauth.html#post–api-oauth-request_token

Parameters:server_url (str) – URL of the server
Return type:dict
Returns:OAuth dict
oauth.authorize_url(server_url, resource_owner_key)

Returns a URL used to obtain user authorization for application access.

Parameters:
  • server_url (str) – URL of the server
  • resource_owner_key (str) – a key used by user to authorize
Return type:

str

Returns:

a URL used to obtain user authorization for application access

oauth.access_token(server_url, *args, **kwargs)

Returns resource owner key and secret for given consumer key and secret.

Accepts the same parameters as requests.post() except url.

Implements https://twitter-api.readthedocs.io/en/latest/oauth.html#post–api-oauth-access_token

Parameters:server_url (str) – URL of the server
Return type:dict
Returns:OAuth dict
oauth.make_oauth_object(consumer_key, consumer_secret, resource_owner_key=None, resource_owner_secret=None, secret_key=None)

Creates an requests_oauthlib.OAuth1 object using given data.

Parameters:
  • consumer_key (str) – a value used by the application to identify itself to the GNU Social server
  • consumer_secret (str) – a secret used by the application to establish ownership of the consumer key
  • resource_owner_key (str) – a key used by user to authorize
  • resource_owner_secret (str) – a secret used by the application to establish ownership of a given token
  • secret_key (str) – a key given to you by GNU Social to get the access token
Return type:

requests_oauthlib.OAuth1