Download authtest.md from Modulo-6/api: direct link, hf CLI and curl.
- Browser
- Download file 1.51 kB
-
https://huggingface.co/spaces/Modulo-6/api/resolve/103258c8c38fd4100cd7bdb3de92a75e82b20ddc/authtest.md
- Command line
-
hf download hf://spaces/Modulo-6/api@103258c8c38fd4100cd7bdb3de92a75e82b20ddc/authtest.md
-
curl -L -o authtest.md https://huggingface.co/spaces/Modulo-6/api/resolve/103258c8c38fd4100cd7bdb3de92a75e82b20ddc/authtest.md
Opción A — si ENVIRONMENT=development en HF
export M6_URL="https://modulo-6-api.hf.space/api/v1"
TOKEN=$(curl -s "$M6_URL/auth/token?usuario=ADMINISTRATIVO&password=x"
| python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])")
curl -s "$M6_URL/_debug/settings" -H "Authorization: Bearer $TOKEN"
Si te devuelve 404 en el primer curl, es que el Space está en production y el endpoint de dev token está deshabilitado a propósito → usá la opción B.
Opción B — vía SSO real contra el Core (M10)
export M6_URL="https://modulo-6-api.hf.space/api/v1" export CORE_URL="https://api.healthcare.cantero.ar"
1. Login real en el Core con un usuario ADMINISTRATIVO
CORE_TOKEN=$(curl -s -X POST "$CORE_URL/auth/login"
-H "Content-Type: application/json"
-d '{"email": "TU_EMAIL", "password": "TU_PASSWORD"}'
| python3 -c "import sys,json; print(json.load(sys.stdin)['token'])")
2. Pedirle un ticket SSO al Core
TICKET=$(curl -s -X POST "$CORE_URL/auth/sso-ticket"
-H "Authorization: Bearer $CORE_TOKEN"
| python3 -c "import sys,json; print(json.load(sys.stdin)['ticket'])")
3. Canjearlo contra M6
M6_TOKEN=$(curl -s -X POST "$M6_URL/auth/sso-exchange"
-H "Content-Type: application/json"
-d '{"ticket": "'"$TICKET"'"}'
| python3 -c "import sys,json; print(json.load(sys.stdin)['token'])")
4. Pegarle al endpoint de debug
curl -s "$M6_URL/_debug/settings" -H "Authorization: Bearer $M6_TOKEN"