geofront.backends.oauth
— Team backend bases for OAuth¶
New in version 0.4.0.
-
class
geofront.backends.oauth.
OAuth2Team
(client_id: str, client_secret: str) → None¶ Base implementation of
Team
for OAuth 2. Every subclass has to implement the following attributes and methods:authorize_url
attributeaccess_token_url
attributescope
attributedetermine_identity()
methodauthorize()
method
-
access_token_url
= NotImplemented¶ (
str
) The url to issue an OAuth 2 access token.Note
Concrete subclass has to implement this method.
(
str
) The scope string for OAuth 2 authorization.Note
Concrete subclass has to implement this method.
(
str
) The OAuth 2 authorization url.Note
Concrete subclass has to implement this method.
-
determine_identity
(access_token: str) → geofront.identity.Identity¶ Determine
Identity
from the given access token.Note
Concrete subclass has to implement this method.
(
str
) The message template which is used when the authenticated identity is unauthorized. There’s a predefined default message, but it can be overridden by subclass. The two keywords are available:identity
- (
Identity
) The authenticated identity. team
- (
OAuth2Team
) The actual team object.
-
geofront.backends.oauth.
request
(access_token, url: str, method: str = 'GET', data: bytes = None)¶ Make a request to GitHub API, and then return the parsed JSON result.
Parameters: