Configuration.api_key* are not really used
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 42/100
Piste de recherche
Commencez par Configuration(api_key=...) et l’exemple de README.md utilisant access_token, puis suivez la manière dont ApiClient authentifie AdminApi->admin_apps_list. Reproduisez le 403 et vérifiez que la configuration choisie produit des requêtes authentifiées ; c’est terminé lorsque la terminologie du token documentée et le comportement de la configuration fonctionnelle sont cohérents.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
I got tempted to pass api_key = 'my-super-duper-secret-key' to the Configuration object, as one has an API key at hand, and all I got was a 403 Error (t-shirt material right there).
import os
import sys
import authentik_client
def main():
host = os.environ.get("AUTHENTIK_HOST") # I passed here a URL ending in "/api/v3" even though is called "host", see #9
token = os.environ.get("AUTHENTIK_TOKEN")
if not token:
print("AUTHENTIK_TOKEN unset")
sys.exit(1)
if not host:
print("AUTHENTIK_URL unset")
sys.exit(1)
configuration = authentik_client.Configuration(
host=host,
api_key=token
)
with authentik_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = authentik_client.AdminApi(api_client)
try:
api_response = api_instance.admin_apps_list()
print("The response of AdminApi->admin_apps_list:\n")
print(api_response)
except authentik_client.ApiException as e:
print("Exception when calling AdminApi->admin_apps_list: %s\n" % e)
if __name__ == "__main__":
main()
When invoking it I got:
python move-okta-app-to-authentik.py
Exception when calling AdminApi->admin_apps_list: (403)
Reason: Forbidden
HTTP response headers: HTTPHeaderDict({'date': 'Thu, 30 Oct 2025 20:47:20 GMT', 'content-type': 'application/json; charset=utf-8', 'content-length': '58', 'allow': 'GET, HEAD, OPTIONS', 'referrer-policy': 'same-origin', 'vary': 'Accept-Encoding, Cookie', 'x-authentik-id': 'af8d40bf08934e5cb8e602be325694f6', 'x-content-type-options': 'nosniff', 'x-frame-options': 'DENY', 'x-powered-by': 'authentik', 'strict-transport-security': 'max-age=31536000; includeSubDomains'})
HTTP response body: detail='Authentication credentials were not provided.' code=None
In fairness the example in the REAMDE.md points out the usage of access_token, however it doesn't really align with the nomenclature.
# Configure Bearer authorization: authentik
configuration = authentik_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
But your API Credential to interact with the server is a "Bootstrap token", and for users you can create "Token"'s, (notice the lack of "Access").
- Langage dominant
- Mustache
- Étoiles
- 2
- Forks
- 1
- Merge moyen
- 15 h 5 min
- PR mergées (30 j)
- 2
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de goauthentik/client-python
-
Data returned from the API on StagesApi().stages_invitation_invitations_create() fails validation Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
goauthentik/client-python#18 · 1 commentaire ·
-
Import times are too slow Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
goauthentik/client-python#11 · 2 commentaires · 1 réaction ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
goauthentik/client-python#9 · 1 réaction ·
Toutes les issues de goauthentik/client-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
mksglu/context-mode#1200 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider issue-rating: 🌊 off-meta tidepool P2
Difficulté 1/5 Moins d'une heure Accessibilité débutants 80/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100