- Detects Dapla environment, service, and region via environment variables
- Retrieves current Dapla region (e.g., checks for DAPLA_LAB)
- Reads Kubernetes service-account token from filesystem
- Exchanges Kubernetes token for Keycloak token in Dapla Lab
- Overrides Google-Auth refresh handler to use custom token fetch logic
- Fetches Google ADC credentials
- Python >3.8 (3.10 is preferred)
- Poetry, install via curl -sSL https://install.python-poetry.org | python3 -
You can install Dapla Auth Client via pip from PyPI:
pip install dapla-auth-client# This code snippet demonstrates how to use the Dapla Auth Client to fetch a personal token.
from dapla_auth_client import AuthClient
print(AuthClient.fetch_personal_token())Contributions are very welcome. To learn more, see the Contributor Guide.
Distributed under the terms of the MIT license, Dapla Auth Client is free and open source software.
If you encounter any problems, please file an issue along with a detailed description.
This project was generated from Statistics Norway's SSB PyPI Template.