:py:mod:`oauth2_service_token_factory` ====================================== .. py:module:: oauth2_service_token_factory .. autoapi-nested-parse:: OAuth2 service token framework for authenticating internal API clients. This module defines a generic `OAuth2ServiceToken` base class for retrieving and caching OAuth2 access tokens using client credentials. It also includes a `OAuth2ServiceTokenFactory` to construct and manage tokens for specific services, such as the Site Capabilities API. Caching, scope extension, and audience targeting are supported, allowing reuse and fine-grained access control of service tokens. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oauth2_service_token_factory.OAuth2ServiceTokenFactory .. py:class:: OAuth2ServiceTokenFactory(site_capabilities_client_params=None, data_management_client_params=None, cache=None) Factory for OAuth2 token retrieval. .. py:attribute:: logger .. py:method:: get_data_management_service_token(audience = None, try_use_cache = True, additional_scopes = None, force_renew = False) :async: Get a service token specifically for the Data Management API. This constructs a `DataManagementServiceToken` instance using the configured OAuth2 client and returns a valid access token. .. py:method:: get_site_capabilities_service_token(audience = None, try_use_cache = True, additional_scopes = None, force_renew = False) :async: Get a service token specifically for the Site Capabilities API. This constructs a `SiteCapabilitiesServiceToken` instance using the configured OAuth2 client and returns a valid access token.