GitHubProvider¶
-
class
gafaelfawr.providers.github.
GitHubProvider
(*, config: GitHubConfig, http_session: ClientSession, issuer: TokenIssuer, session_store: SessionStore, logger: BoundLogger)¶ Bases:
gafaelfawr.providers.base.Provider
Authenticate a user with GitHub.
Parameters: - config (
gafaelfawr.config.GitHubConfig
) – Configuration for the GitHub authentication provider. - http_session (
aiohttp.ClientSession
) – Session to use to make HTTP requests. - issuer (
gafaelfawr.issuer.TokenIssuer
) – Issuer to use to generate new tokens. - session_store (
gafaelfawr.session.SessionStore
) – Store for authentication sessions. - logger (
structlog.BoundLogger
) – Logger for any log messages.
Methods Summary
create_session
(code, state)Given the code from a successful authentication, create a session. get_redirect_url
(state)Get the login URL to which to redirect the user. Methods Documentation
-
create_session
(code: str, state: str) → gafaelfawr.session.Session¶ Given the code from a successful authentication, create a session.
Parameters: Returns: session – The new authentication session.
Return type: Raises: aiohttp.ClientResponseError
– An HTTP client error occurred trying to talk to the authentication provider.GitHubException
– GitHub responded with an error to a request.
- config (