AuthorizationService
Inherits: Authorization
OAuth authorization implementation used by Page.login().
The service coordinates authorization URL generation, token exchange,
token refresh, and optional user/group resolution using the configured
OAuthProvider.
Parameters:
-
provider(OAuthProvider) –Configured
OAuthProviderdescribing OAuth endpoints, credentials, and optional user/group APIs. -
fetch_user(bool) –Whether to request provider user profile information.
-
fetch_groups(bool) –Whether to request user groups/roles.
-
scope(list[str] | None, default:None) –Initial OAuth scopes. The service augments this list with provider defaults (
provider.scopes) and, when enabled, provider user/group scopes.
Properties
-
fetch_groups– -
fetch_user– -
provider– -
scope– -
user(User | None) –
Methods
-
dehydrate_token–Restore and validate previously persisted token state.
-
get_authorization_data–Generate authorization URL and CSRF state for OAuth redirect flow.
-
get_token–Return current token after applying refresh logic when required.
-
request_token–Exchange authorization code for access token and optional profile data.
Properties#
Methods#
dehydrate_token
async
#
dehydrate_token(saved_token: str)
Restore and validate previously persisted token state.
The token is deserialized, refreshed when expired, and optionally used to load user and group metadata.
Parameters:
-
saved_token(str) –JSON-serialized token data produced by
OAuthToken.to_json().
get_authorization_data
#
get_token
async
#
Return current token after applying refresh logic when required.
Returns:
-
–
Current
OAuthToken, orNoneif no token is available yet.