Skip to content

A service declares its provider's consent-query quirks - #299

Merged
czpython merged 1 commit into
mainfrom
authorize-params
Aug 22, 2026
Merged

A service declares its provider's consent-query quirks#299
czpython merged 1 commit into
mainfrom
authorize-params

Conversation

@czpython

@czpython czpython commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Google grants a refresh token only when the consent URL carries access_type=offline and prompt=consent. Until now the only door was subclassing OauthClient and overriding get_oauth_client(), duplicating the whole base construction just to swap the class.

OauthClient takes extra_authorize_params and lands them in every consent query it begins; begin_connect's own argument layers over them on a shared key. Service declares them as a ClassVar and get_oauth_client() passes them through, so an extension states the quirk in one line next to its endpoints:

class Acme(Service):
    authorization_endpoint = "https://acme.example/oauth/authorize"
    token_endpoint = "https://acme.example/oauth/token"
    extra_authorize_params = {"access_type": "offline", "prompt": "consent"}

Connection also exposes identity — the provider's facts for the sign-in — so extensions read it off the handle, not the row.

The identity column the handle reads landed in #298.

@czpython
czpython force-pushed the connection-identity branch from ca8ba69 to 3baacd0 Compare August 22, 2026 06:01
Base automatically changed from connection-identity to main August 22, 2026 06:03
Google grants a refresh token only when the consent URL carries
access_type=offline and prompt=consent. Until now the only door was
subclassing OauthClient and overriding get_oauth_client(), duplicating
the whole base construction just to swap the class.

OauthClient takes extra_authorize_params and lands them in every consent
query it begins; begin_connect's own argument layers over them on a
shared key. Service declares them as a ClassVar and get_oauth_client()
passes them through, so an extension states the quirk in one line next
to its endpoints.

Connection also exposes identity — the provider's facts for the
sign-in — so extensions read it off the handle, not the row.
@czpython
czpython merged commit 6770814 into main Aug 22, 2026
1 check passed
@czpython
czpython deleted the authorize-params branch August 22, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant