Skip to content

Commit

Permalink
doc/local-instance.md: update API endpoint responses
Browse files Browse the repository at this point in the history
Update response of API `/whoami` request in the section
for creating admin API token. Also, improve response
of `/user/login` endpoint to remove sample API token
and put a string instead.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia authored and nuclearcat committed Dec 5, 2023
1 parent b1178d7 commit cfcdc47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/local-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ $ curl -X 'POST' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'username=admin&password=hello'
{"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJib2IifQ.KHkILtsJaCmueOfFCj79HGr6kHamuZFdB1Yz_5GqcC4","token_type":"bearer"}
{"access_token":"<your-api-token>","token_type":"bearer"}
```

The token can now be used with API entry points that require authentication.
Expand All @@ -121,7 +121,8 @@ $ curl -X 'GET' \
'http://localhost:8001/latest/whoami' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJib2IifQ.KHkILtsJaCmueOfFCj79HGr6kHamuZFdB1Yz_5GqcC4'
{"id":"615f30020eb7c3c6616e5ac3","profile": {"username":"admin","hashed_password":"$2b$12$VtfVij6zz20F/Qr0Ri18O.11.0LJMMXyJxAJAHQbKU0jC96eo2fr.", "groups": "admin", "email": "[email protected]"},"active":true}
{"id":"615f30020eb7c3c6616e5ac3", "email": "[email protected]", "is_active":true, "is_superuser":true, "is_verified":true,
"groups": [{"id":"648c07a70fccad400a122509","name":"admin"}], "username":"admin"}
```

### Setup SSH keys
Expand Down

0 comments on commit cfcdc47

Please sign in to comment.