|
| 1 | +# 🔐 easySSP Authentication Python Client |
| 2 | + |
| 3 | +This module provides a simple and secure way to authenticate with the easySSP API using JWT tokens. It performs the |
| 4 | +initial login with username and password, requests the access and refresh tokens from the authentication endpoint, |
| 5 | +and renews the access token when it expires using the refresh token. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 🚀 Features |
| 10 | + |
| 11 | +- 🔑 Retrieves JSON Web Tokens (JWTs) based on user credentials |
| 12 | +- 🗂️ Securely manages credentials and access/refresh tokens |
| 13 | +- ♻️ Automatically renews expired access tokens |
| 14 | + |
| 15 | +## 🔐 Access Requirements |
| 16 | + |
| 17 | +- Requires an easySSP **Pro** or **Process Edition** account |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## 🛠️ How It Works |
| 22 | + |
| 23 | +1. **Create the `AuthClient` instance** |
| 24 | + |
| 25 | +```python |
| 26 | +from easyssp_auth.authentication import AuthClient, AuthError |
| 27 | + |
| 28 | +try: |
| 29 | + auth_client = AuthClient("your_easyssp_username", "your_easyssp_password", "your-client-id") |
| 30 | +except AuthError as ex: |
| 31 | + print(ex) |
| 32 | +``` |
| 33 | + |
| 34 | +2. **Retrieve the access token** |
| 35 | + |
| 36 | +```python |
| 37 | +access_token = auth_client.get_access_token() |
| 38 | +``` |
| 39 | + |
| 40 | +3. **Authenticate your requests** |
| 41 | +You can use the retrieved access token in the `Authorization` header of your requests to authenticate with the easySSP API. |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## 📦 Installation |
| 46 | + |
| 47 | +```bash |
| 48 | +pip install easyssp-auth-client |
| 49 | +``` |
| 50 | + |
| 51 | +Or clone and install from source: |
| 52 | + |
| 53 | +```bash |
| 54 | +git clone https://github.com/exxcellent/easyssp-auth-client-python.git |
| 55 | +cd easyssp-auth-client-python |
| 56 | +pip install -e . |
| 57 | +``` |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## 📁 Project Structure |
| 62 | + |
| 63 | +```bash |
| 64 | +easyssp_auth/ |
| 65 | +├── __init__.py |
| 66 | +├── authentication.py # Core logic for obtaining and storing the token |
| 67 | +``` |
| 68 | + |
| 69 | +## 🛠️ Technical Requirements |
| 70 | + |
| 71 | +- Python 3.11+ |
| 72 | + |
| 73 | +Install dependencies using uv: |
| 74 | + |
| 75 | +```bash |
| 76 | +pip install uv |
| 77 | +uv sync |
| 78 | +``` |
| 79 | + |
| 80 | +## 🤝 Contributing |
| 81 | + |
| 82 | +This module is maintained as part of the easySSP ecosystem. If you find issues or want to suggest improvements, please |
| 83 | +open an issue or submit a pull request. |
| 84 | + |
| 85 | +## 📄 License |
| 86 | + |
| 87 | +This project is licensed under the MIT License. |
0 commit comments