oauth_dropins
Reference documentation.
bluesky
Bluesky auth drop-in. Supports both app password login and OAuth.
Use PasswordStart and PasswordCallback for app password,
class:OAuthStart and OAuthCallback for OAuth.
https://atproto.com/specs/xrpc#:~:text=App,passwords https://docs.bsky.app/docs/advanced-guides/oauth-client https://atproto.com/specs/oauth https://guillp.github.io/requests_oauth2client/ https://github.com/guillp/requests_oauth2client?tab=readme-ov-file#using-dpop
- class BlueskyLogin(**kwargs)[source]
Bases:
ModelAn in-progress Bluesky OAuth login. Ephemeral.
Stores a serialized
requests_oauth2client.AuthorizationRequestacross HTTP requests.- authz_request
Serialized
requests_oauth2client.AuthorizationRequest.Uses
requests_oauth2client.AuthorizationRequestSerializer.default_dumper()/requests_oauth2client.AuthorizationRequestSerializer.default_loader().
- class BlueskyAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Bluesky user.
Key id is DID.
- user_json
app.bsky.actor.defs#profileViewDetailed
- oauth_api(client_metadata)[source]
Returns an OAuth-based
lexrpc.Clientfor this user.Requires
dpop_tokento be set.- Parameters:
client_metadata (dict) – client info metadata, https://docs.bsky.app/docs/advanced-guides/oauth-client#client-and-server-metadata
- Return type:
lexrpc.Client
- class StartBase(to_path, scopes=None)[source]
Bases:
StartBase class for starting Bluesky auth; only used to provide the button.
- class PasswordCallback(to_path, scopes=None)[source]
Bases:
CallbackApp password login callback stub.
- Callback
alias of
PasswordCallback
- pds_for_did(did)[source]
Resolves a DID document and extracts its PDS URL.
https://atproto.com/specs/did#did-documents
- Parameters:
did (str)
- Returns:
PDS URL
- Return type:
- Raises:
ValueError – if the DID couldn’t be resolved, or if its DID document has no
ATProto PDS endpoint –
- oauth_client_for_pds(client_metadata, pds_url, redirect_uri=None)[source]
Discovers a PDS’s OAuth endpoints and creates a client.
- Parameters:
- Return type:
OAuth2Client
- Raises:
ValueError – if the DID couldn’t be resolved, or if its DID document has no
ATProto PDS endpoint –
- class OAuthStart(to_path, scopes=None)[source]
Bases:
StartBaseStarts the OAuth flow.
- Subclasses must populate:
CLIENT_METADATA(dict): client info metadata, https://docs.bsky.app/docs/advanced-guides/oauth-client#client-and-server-metadata
- redirect_url(state=None, handle=None)[source]
Returns the URL for Bluesky to redirect back to after the OAuth prompt.
- Parameters:
- Raises:
ValueError, RequestException – if handle isn’t a valid domain
- class OAuthCallback(to_path, scopes=None)[source]
Bases:
CallbackFinishes the OAuth flow.
- Subclasses must populate:
CLIENT_METADATA(dict): client info metadata, https://docs.bsky.app/docs/advanced-guides/oauth-client#client-and-server-metadata
disqus
Disqus OAuth drop-in.
Disqus API docs: https://disqus.com/api/docs/
This drop-in is even more similar to Instagram than Instagram is to Facebook. Differences:
urlopen must pass the
api_keywith each request (in addition to theaccess_token)Response to access_token does not give much information about the user, so we additionally fetch
/user/detailsbefore savingDeny appears to be broken on Disqus’s side (clicking “No Thanks” has no effect), so we ignore that possibility for now.
TODO: unify Disqus, Facebook, and Instagram
- class DisqusAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Disqus user.
Provides methods that return information about this user (or page) and make OAuth-signed requests to Instagram’s HTTP-based APIs. Stores OAuth credentials in the datastore. See
models.BaseAuthfor usage details.Disqus-specific details: implements
urlopen()but notapi(). The key name is the Disqus user id.
- class Start(to_path, scopes=None)[source]
Bases:
StartStarts Disqus auth. Requests an auth code and expects a redirect back.
dropbox
Dropbox OAuth drop-in.
Standard OAuth 2.0 flow. Docs:
https://www.dropbox.com/developers/documentation/http/overview
https://www.dropbox.com/developers/documentation/http/documentation#authorization
- class DropboxAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Dropbox user or page.
Provides methods that return information about this user (or page) and make OAuth-signed requests to Dropbox’s HTTP-based APIs. Stores OAuth credentials in the datastore. See
models.BaseAuthfor usage details.Implements
urlopen()but notapi().
facebook
Facebook OAuth drop-in.
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow
- class FacebookAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Facebook user or page.
Provides methods that return information about this user (or page) and make OAuth-signed requests to Facebook’s HTTP-based APIs. Stores OAuth credentials in the datastore. See models.BaseAuth for usage details.
Facebook-specific details: implements
urlopen()but notapi(). The key name is the user’s or page’s Facebook ID.- for_page(page_id)[source]
Returns a new, unsaved
FacebookAuthentity for a page inpages_json.The returned entity’s properties will be populated with the page’s data. access_token will be the page access token,
user_jsonwill be the page object, andpages_jsonwill be a single-element list with the page.If
page_idis not inpages_json, returns None.- Parameters:
page_id (str) – Facebook page id
- class Start(to_path, scopes=None)[source]
Bases:
StartStarts Facebook auth. Requests an auth code and expects a redirect back.
flickr
Flickr OAuth drop-in.
Uses oauthlib directly to authenticate and sign requests with OAuth 1.0 credentials. https://www.flickr.com/services/api/auth.oauth.html
Note that when users decline Flickr’s OAuth prompt by clicking the Cancel button, Flickr redirects them to its home page, not to us.
- class FlickrAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Flickr user.
Provides methods that return information about this user and make OAuth-signed requests to the Flickr API. Stores OAuth credentials in the datastore. Key is the Flickr user ID. See models.BaseAuth for usage details.
flickr_auth
Utility functions for calling signed Flickr API methods.
Supports Python 3. Should not depend on App Engine API or SDK packages.
- signed_urlopen(url, token_key, token_secret, **kwargs)[source]
Call
urllib.request.urlopen(), signing the request with Flickr credentials.- Parameters:
- Returns:
the file-like object that is the result of
urllib.request.urlopen()
- call_api_method(method, params, token_key, token_secret)[source]
Call a Flickr API method.
Flickr has one API endpoint, where different methods are called by name.
If the
statfield containsfail, then this method creates an artificial HTTPError 400 or 401 depending on the type of failure.
- upload(params, file, token_key, token_secret)[source]
Upload a photo or video to this user’s Flickr account.
Flickr uploads use their own API endpoint, that returns only XML. https://www.flickr.com/services/api/upload.api.html
Unlike
call_api_method(), this uses the requests library becauseurllibdoesn’t support multi-part POSTs on its own.- Parameters:
- Returns:
contains the photo id as
id- Return type:
- Raises:
github
GitHub OAuth drop-in.
API docs:
- class GitHubAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated GitHub user.
Provides methods that return information about this user and make OAuth-signed requests to the GitHub REST API. Stores OAuth credentials in the datastore. See
models.BaseAuthfor usage details.GitHub-specific details: implements
get()but noturlopen(), orapi(). The key name is the username.- get(*args, **kwargs)[source]
Wraps
requests.get()and adds the Bearer token header.
- post(*args, **kwargs)[source]
Wraps
requests.post()and adds theBearertoken header.
google_signin
Google Sign-In OAuth drop-in.
Google Sign-In API docs: https://developers.google.com/identity/protocols/OAuth2WebServer
Python API client docs: https://developers.google.com/api-client-library/python/
requests-oauthlib docs:
- class GoogleUser(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Google user.
Provides methods that return information about this user and make OAuth-signed requests to Google APIs. Stores OAuth credentials in the datastore. See
models.BaseAuthfor usage details.To make Google API calls: https://google-auth.readthedocs.io/
indieauth
IndieAuth drop-in.
- class IndieAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated IndieAuth user.
Provides methods that return information about this user. Stores credentials in the datastore. Key is the authed
meURL value. Seemodels.BaseAuthfor usage details.
instagram
Instagram OAuth drop-in.
Instagram API docs: http://instagram.com/developer/endpoints/
Almost identical to Facebook, except the access token request has code and grant_type query parameters instead of just auth_code, the response has a user object instead of id, and the call to GET_ACCESS_TOKEN_URL is a POST instead of a GET. TODO: unify them.
- class InstagramAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Instagram user or page.
Provides methods that return information about this user (or page) and make OAuth-signed requests to Instagram’s HTTP-based APIs. Stores OAuth credentials in the datastore. See models.BaseAuth for usage details.
Instagram-specific details: implements urlopen() but not api(). The key name is the Instagram username.
linkedin
LinkedIn OAuth drop-in.
API docs: https://www.linkedin.com/developers/ https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin
- class LinkedInAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated LinkedIn user.
Provides methods that return information about this user and make OAuth-signed requests to the LinkedIn REST API. Stores OAuth credentials in the datastore. See models.BaseAuth for usage details.
Implements get() but not urlopen() or api(). The key name is the ID (a URN).
Note that LI access tokens can be over 500 chars (up to 1k!), so they need to be TextProperty instead of StringProperty. https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/consumer/context#access-token-response
mastodon
Mastodon OAuth drop-in.
Mastodon is an ActivityPub implementation, but it also has a REST + OAuth 2 API independent of AP.
API docs: https://docs.joinmastodon.org/api/
Interestingly: as usual w/OAuth, they require registering apps beforehand…but since AP and Mastodon are decentralized, there’s no single place to register an app. So they have an API for registering apps, per instance: https://docs.joinmastodon.org/api/authentication/ Surprising, and unusual, but makes sense.
- class MastodonApp(**kwargs)[source]
Bases:
ModelA Mastodon API OAuth2 app registered with a specific instance.
- class MastodonLogin(**kwargs)[source]
Bases:
ModelAn in-progress Mastodon OAuth login. Ephemeral.
Stores the state query parameter across the three-way OAuth user login process. Only needed as a workaround for a long-standing Mastodon/Doorkeeper configuration bug: https://github.com/snarfed/bridgy/issues/911 https://github.com/mastodon/mastodon/issues/12915
- class MastodonAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Mastodon user.
Provides methods that return information about this user and make OAuth-signed requests to the Mastodon REST API. Stores OAuth credentials in the datastore. See models.BaseAuth for usage details.
Key name is the fully qualified actor address, ie @username@instance.tld.
Mastodon scopes are per access token, so
SCOPES_RESETis True.Implements get() and post() but not urlopen() or api().
- instance()[source]
Returns the instance base URL, eg https://mastodon.social/.
- Raises:
RuntimeError – when the
MastodonAppcan’t be loaded
- actor_id()[source]
Returns the user’s ActivityPub actor id URL.
Example:
https://mastodon.social/users/ryan
- class Start(to_path, scopes=None)[source]
Bases:
StartStarts Mastodon auth. Requests an auth code and expects a redirect back.
- DEFAULT_SCOPE
string, default OAuth scope(s) to request
- REDIRECT_PATHS
sequence of string URL paths (on this host) to register as OAuth callback (aka redirect) URIs in the OAuth app
- SCOPE_SEPARATOR
string, used to separate multiple scopes
- APP_CLASS
API app datastore class
- EXPIRE_APPS_BEFORE
datetime, if the API client app was created before this, it will be discarded and a new one will be created. Set to the last time you changed something material about the client, eg redirect URLs or scopes.
- APP_CLASS
alias of
MastodonApp
- app_name()[source]
Returns the user-visible name of this application.
To be overridden by subclasses. Displayed in Mastodon’s OAuth prompt.
- app_url()[source]
Returns this application’s web site.
To be overridden by subclasses. Displayed in Mastodon’s OAuth prompt.
- redirect_url(state=None, instance=None)[source]
Returns the local URL for Mastodon to redirect back to after OAuth prompt.
- Parameters:
state – string, user-provided value to be returned as a query parameter in the return redirect
instance – string, Mastodon instance base URL, e.g. ‘https://mastodon.social’. May also be provided in the ‘instance’ request as a URL query parameter or POST body.
Raises: ValueError if instance isn’t a Mastodon instance.
- class Callback(to_path, scopes=None)[source]
Bases:
CallbackThe OAuth callback. Fetches an access token and stores it.
- AUTH_CLASS
alias of
MastodonAuth
meetup
Meetup.com drop-in.
API docs: https://www.meetup.com/meetup_api/
- urlopen_bearer_token(url, access_token, data=None, **kwargs)[source]
Wraps urlopen() and adds OAuth credentials to the request.
- class MeetupAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Meetup.com user.
Provides methods that return information about this user and make OAuth-signed requests to Meetup’s HTTP-based APIs. Stores OAuth credentials in the datastore. See models.BaseAuth for usage details.
Implements urlopen() but not api().
- class MeetupCsrf(**kwargs)[source]
Bases:
ModelStores a CSRF token for the Meetup.com OAuth2 flow.
models
Base datastore model class for an authenticated account.
- class BaseAuth(*args, id=None, **kwargs)[source]
Bases:
StringIdModelDatastore base model class for an authenticated user.
Provides methods that return information about this user and make OAuth-signed requests to the site’s API(s). Stores OAuth credentials in the datastore.
The key name is usually the user’s username or id. If it starts with two underscores (
__), this class will prefix it with a\character, since that prefix is not allowed in datastore key names: https://cloud.google.com/datastore/docs/concepts/entitiesMany sites provide additional methods and store additional user information in a JSON property.
- SCOPES_RESET
True if scopes granted to a given user reset to the just the most recent scopes requested, False if they accumulate across auth flows. Currently unused, informational only.
- Type:
- api()[source]
Returns the site-specific Python API object, if any.
Returns None if the site doesn’t have a Python API. Only some do, currently Instagram, Google, and Tumblr.
- access_token()[source]
Returns the OAuth access token.
This is a string for OAuth 2 sites or a (string key, string secret) tuple for OAuth 1.1 sites (currently just Twitter and Tumblr).
- urlopen(url, **kwargs)[source]
Wraps urllib.request.urlopen() and adds OAuth credentials to the request.
Use this for making direct HTTP REST request to a site’s API. Not guaranteed to be implemented by all sites.
The arguments, return value (urllib.request.Response), and exceptions raised (urllib.error.URLError) are the same as urllib2.urlopen.
- is_authority_for(key)[source]
When disabling or modifying an account, it’s useful to re-auth the user to make sure they have have permission to modify that account. Typically this means the auth entity represents the exact same user, but in some cases (e.g., Facebook Pages), a user may control several unique identities. So authenticating as a user should give you authority over their pages.
- Parameters:
key – ndb.Key
- Returns:
boolean, true if key represents the same account as this entity
- class OAuthRequestToken(**kwargs)[source]
Bases:
StringIdModelDatastore model class for an OAuth 1.1 request token.
This is only intermediate data. Client should use BaseAuth subclasses to make API calls.
The key name is the token key.
- class PkceCode(**kwargs)[source]
Bases:
StringIdModelAn OAuth2 PKCE code challenge and code verifier.
The key name is the state query param value.
pixelfed
Pixelfed OAuth drop-in.
Pixelfed’s API is a clone of Mastodon’s v1 API: https://docs.pixelfed.org/technical-documentation/api-v1.html
- class PixelfedApp(**kwargs)[source]
Bases:
MastodonAppA Pixelfed API OAuth2 app registered with a specific instance.
- class PixelfedAuth(*args, id=None, **kwargs)[source]
Bases:
MastodonAuthAn authenticated Pixelfed user.
- class Start(to_path, scopes=None)[source]
Bases:
StartStarts Pixelfed auth. Requests an auth code and expects a redirect back.
- APP_CLASS
alias of
PixelfedApp
- class Callback(to_path, scopes=None)[source]
Bases:
CallbackThe OAuth callback. Fetches an access token and stores it.
- AUTH_CLASS
alias of
PixelfedAuth
reddit
reddit OAuth drop-in.
reddit API docs: https://github.com/reddit-archive/reddit/wiki/API https://www.reddit.com/dev/api https://www.reddit.com/prefs/apps
praw API docs: https://praw.readthedocs.io/en/v3.6.0/pages/oauth.html
- class RedditAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated reddit user.
Provides methods that return information about this user and make OAuth-signed requests to the Tumblr API. Stores OAuth credentials in the datastore. See models.BaseAuth for usage details.
reddit-specific details: implements “access_token,” which is really a refresh_token see: https://stackoverflow.com/questions/28955541/how-to-get-access-token-reddit-api The datastore entity key name is the reddit username.
- class Start(to_path, scopes=None)[source]
Bases:
StartStarts reddit auth. goes directly to redirect. passes to_path in “state”
- class Callback(to_path, scopes=None)[source]
Bases:
CallbackOAuth callback. Only ensures that identity access was granted.
- praw_to_user(user)[source]
Converts a PRAW user to a dict user.
- Parameters:
user –
praw.models.Redditor
Note 1: accessing redditor attributes lazily calls reddit API Note 2: if user.is_suspended is True, other attributes will not exist Note 3: subreddit refers to a user profile (stored as a subreddit) Ref: https://praw.readthedocs.io/en/latest/code_overview/models/redditor.html
Returns: dict
- Raises:
prawcore.exceptions.NotFound –
deleted –
threads
Threads OAuth 2 drop-in.
https://developers.facebook.com/docs/threads/
- class ThreadsAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn OAuth-authenticated Threads user.
Provides methods that return information about this user and store OAuth 2 tokens in the datastore. See models.BaseAuth for usage details.
The datastore entity key name is the integer user id.
- session()[source]
Returns a
requests_oauthlib.OAuth2Session.
tumblr
Tumblr OAuth drop-in.
API docs: http://www.tumblr.com/docs/en/api/v2 http://www.tumblr.com/oauth/apps
- class TumblrAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Tumblr user.
Provides methods that return information about this user and make OAuth-signed requests to the Tumblr API. Stores OAuth credentials in the datastore. See models.BaseAuth for usage details.
Tumblr-specific details: implements api() but not urlopen(). api() returns a tumblpy.Tumblpy. The datastore entity key name is the Tumblr username.
twitter
Twitter OAuth drop-in.
TODO: port to http://code.google.com/p/oauth/source/browse/#svn%2Fcode%2Fpython . tweepy is just a wrapper around that anyway.
- class TwitterAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated Twitter user.
Provides methods that return information about this user and make OAuth-signed requests to the Twitter v1.1 API. Stores OAuth credentials in the datastore. See models.BaseAuth for usage details.
Twitter-specific details: implements api(), get(), and post(). api() returns a tweepy.API; get() and post() wrap the corresponding requests methods. The datastore entity key name is the Twitter username.
- class Start(to_path, scopes=None, access_type=None)[source]
Bases:
StartStarts three-legged OAuth with Twitter.
Fetches an OAuth request token, then redirects to Twitter’s auth page to request an access token.
- access_type
optional, ‘read’ or ‘write’. Passed through to Twitter as x_auth_access_type. If the twitter app has read/write or read/write/dm permissions, this lets you request a read-only token. Details: https://dev.twitter.com/docs/api/1/post/oauth/request_token
twitter_auth
Utility functions for generating Twitter OAuth headers and making API calls.
This is a separate module from twitter.py so that projects like granary can use it without pulling in App Engine dependencies.
Supports Python 3. Should not depend on App Engine API or SDK packages.
- auth_header(url, token_key, token_secret, method='GET')[source]
Generates an Authorization header and returns it in a header dict.
- Parameters:
url – string
token_key – string
token_secret – string
method – string
- Returns:
single element with key ‘Authorization’
- Return type:
twitter_v2
Twitter OAuth 2 drop-in.
https://developer.twitter.com/en/docs/authentication/oauth-2-0/user-access-token https://developer.twitter.com/en/docs/authentication/oauth-2-0/authorization-code https://developer.twitter.com/en/docs/authentication/api-reference/token
- class TwitterOAuth2(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn OAuth2-authenticated Twitter user.
Provides methods that return information about this user and store OAuth 2 tokens in the datastore. See models.BaseAuth for usage details.
The datastore entity key name is the Twitter username.
- session()[source]
Returns a
requests_oauthlib.OAuth2Session.
views
Base OAuth flow views. Clients should use the individual site modules.
Example usage:
app = Flask()
app.add_url_rule('/start',
view_func=twitter.Start.as_view('start', '/callback'),
methods=['POST'])
app.add_url_rule('/callback',
view_func=twitter.Callback.as_view('callback', '/after'))
- class BaseView(to_path, scopes=None)[source]
Bases:
ViewBase view class. Provides the to() factory method.
- classmethod make_scope_str(extra)[source]
Returns an OAuth scopes query parameter value.
Combines
DEFAULT_SCOPEand extra.- Parameters:
extra (sequence of str, or None)
- class Start(to_path, scopes=None)[source]
Bases:
BaseViewBase class for starting an OAuth flow.
Users should use the
to()class method when using this view in a WSGI application. See the file docstring for details.If the
statequery parameter is provided in the request data, it will be returned to the client in the OAuth callback view. If thescopequery parameter is provided, it will be added to the existing OAuth scopes.Alternatively, clients may call
redirect_url()and HTTP 302 redirect to it manually, which will start the same OAuth flow.- redirect_url(state=None)[source]
Returns the local URL for the OAuth service to redirect back to.
Subclasses must implement this.
- Parameters:
state (str) – user-provided value to be returned as a query parameter in the return redirect
- classmethod button_html(to_path, form_classes='', form_method='post', form_extra='', image_prefix='', image_file=None, input_style='', scopes='', outer_classes='')[source]
Returns an HTML string with a login form and button for this site.
- Parameters:
to_path (str) – path or URL for the form to POST to
form_classes (str) – optional, HTML classes to add to the <form>
form_classes – optional, HTML classes to add to the outer <div>
form_method (str) – optional, form action ie HTTP method, eg ‘get’; defaults to ‘post’
form_extra (str) – optional, extra HTML to insert inside the <form> before the button
scopes (str) – optional, OAuth scopes to override site’s default(s)
image_prefix (str) – optional, prefix to add to the beginning of image URL path, eg ‘/oauth_dropins/’
image_file (str) – optional, image filename. defaults to [cls.NAME].png
input_style (str) – optional, inline style to apply to the button <input>
- Return type:
- class Callback(to_path, scopes=None)[source]
Bases:
BaseViewBase OAuth callback view.
Users can use
to_url()when using this view in a WSGI application to make it redirect to a given URL path on completion. See file docstring for details.Alternatively, you can subclass it and implement
finish(), which will be called in the OAuth callback request directly, after the user has been authenticated.The auth entity and optional state parameter provided to Start will be passed to
finish()or as query parameters to the redirect URL.
- get_logins()[source]
Returns all current logged in sessions, as auth entity keys.
- Returns:
logged in auth entities
- Return type:
list of
google.cloud.ndb.key.Key
wordpress_rest
WordPress.com OAuth drop-in.
API docs:
Note that unlike Blogger and Tumblr, WordPress.com’s OAuth tokens are per blog. It asks you which blog to use on its authorization page.
Also, wordpress.com doesn’t let you use an oauth redirect URL with “local” or “localhost” anywhere in it. A common workaround is to map an arbitrary host to localhost in your /etc/hosts, e.g.:
127.0.0.1 my.dev.com
You can then test on your local machine by running dev_appserver and opening http://my.dev.com:8080/ instead of http://localhost:8080/ .
- class WordPressAuth(*args, id=None, **kwargs)[source]
Bases:
BaseAuthAn authenticated WordPress user or page.
Provides methods that return information about this user (or page) and make OAuth-signed requests to the WordPress REST API. Stores OAuth credentials in the datastore. See models.BaseAuth for usage details.
WordPress-specific details: implements
urlopen()but notapi(). The key name is the blog hostname.- urlopen(url, **kwargs)[source]
Wraps
urllib.request.urlopen()and adds OAuth credentials.