Skip to main content

Module oauth_flow

Module oauth_flow 

Source
Expand description

OAuth 1.0a three-legged sign-in for SmugMug, used to obtain an access token pair from just the API key and secret. Uses the out-of-band (“oob”) callback: the user approves access in a browser and SmugMug shows a 6-digit verifier code to type back into the CLI.

Structs§

OAuthEndpoints
Endpoints for the sign-in flow; overridable so tests can point at a mock server.
TokenPair
A token/secret pair returned by one of the OAuth token endpoints.

Functions§

authorize_url
Step 2: the URL where the user approves access. Full access with modify permission is needed for uploads and deletes.
get_access_token
Step 3: exchange the request token plus the verifier code the user was shown for a long-lived access token.
get_request_token
Step 1: get a temporary request token, signed with only the API key and secret.