Skip to content

Commit 70a56a7

Browse files
consistent username references, and update authentication api calls
1 parent cc18301 commit 70a56a7

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

python/rag/healthcare-support-portal/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,19 +1003,17 @@ Each service provides interactive API documentation:
10031003
curl -X POST "http://localhost:8001/api/v1/auth/register" \
10041004
-H "Content-Type: application/json" \
10051005
-d '{
1006-
"email": "[email protected]",
1006+
"username": "dr_smith",
1007+
"email": "[email protected]",
10071008
"password": "secure_password",
10081009
"role": "doctor",
10091010
"department": "cardiology"
10101011
}'
10111012

10121013
# Login to get JWT token
10131014
curl -X POST "http://localhost:8001/api/v1/auth/login" \
1014-
-H "Content-Type: application/json" \
1015-
-d '{
1016-
"email": "[email protected]",
1017-
"password": "secure_password"
1018-
}'
1015+
-H "Content-Type: application/x-www-form-urlencoded" \
1016+
-d "username=dr_smith&password=secure_password"
10191017
```
10201018

10211019
### 2. Upload Medical Documents
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
# Get authentication token for dr_smith user
3+
# This script demonstrates the correct username format for API calls
4+
5+
TOKEN=$(curl -s -X POST "http://localhost:8001/api/v1/auth/login" \
6+
-H "Content-Type: application/x-www-form-urlencoded" \
7+
-d "username=dr_smith&password=secure_password" | \
8+
python3 -c "import sys, json; print(json.load(sys.stdin)['access_token'])")
9+
10+
echo "Got auth token: ${TOKEN:0:20}..."
11+
12+
# Export the token for use in other scripts
13+
export AUTH_TOKEN="$TOKEN"
14+
echo "Token exported as AUTH_TOKEN environment variable"
15+
echo "You can now use it in other curl commands like:"
16+
echo "curl -H \"Authorization: Bearer \$AUTH_TOKEN\" http://localhost:8002/api/v1/patients/"

0 commit comments

Comments
 (0)