OAuth

oauth.request_token(server_url, consumer_key, consumer_secret)
Returns resource owner key and secret for given consumer key and secret.
Parameters:
  • server_url (str) – URL of the server
  • 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
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, consumer_key, consumer_secret, resource_owner_key, resource_owner_secret, secret_key)
Returns resource owner key and secret for given consumer key and secret.
Parameters:
  • server_url (str) – URL of the server
  • 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:

dict

Returns:

OAuth dict