Skip to content

Commit

Permalink
Update docker.md (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
chnixi authored Nov 1, 2024
1 parent 7ab62fc commit 73d6097
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions docs/install/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following command will automatically pull and launch the latest application
In this example the image is launched as a container called `keystone` and the API is mapped to port 8000 on the local machine.

```bash
docker run --detach --publish 8000:8000 --name keystone ghcr.io/better-hpc/keystone-api
docker run --detach --publish 8000:80 --name keystone ghcr.io/better-hpc/keystone-api
```

The health of the running API instance can be checked by querying the API `health` endpoint.
Expand All @@ -28,23 +28,30 @@ New administrator accounts can also be created manually by running the `keystone
docker exec -i -t keystone keystone-api createsuperuser
```

You can test the new credentials by authenticating against the API and generating a pair of JWT tokens.
Keystone uses session tokens to manage user authentication and permissions
You can test the new credentials by authenticating against the API and generating a new authentication token.

```bash
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"username": "[USERNAME]", "password": "[PASSWORD]"}' \
http://localhost:80/api/token/
credentials='{"username": "user", "password": "userpassword"}'
headers='Content-Type: application/json'

curl -s -X POST \
-c cookies.txt \
-H "$headers" \
-d "$credentials" \
http://localhost:8000/authentication/login/

cat cookies.txt
```

If successful, you will receive a response similar to the following:
If successful, the cookies file will contain a `sessionid` token similar to the following:

```
# Netscape HTTP Cookie File
# https://curl.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
```json
{
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX3BrIjoxLCJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiY29sZF9zdHVmZiI6IuKYgyIsImV4cCI6MTIzNDU2LCJqdGkiOiJmZDJmOWQ1ZTFhN2M0MmU4OTQ5MzVlMzYyYmNhOGJjYSJ9.NHlztMGER7UADHZJlxNG0WSi22a2KaYSfd1S-AuT7lU",
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX3BrIjoxLCJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImNvbGRfc3R1ZmYiOiLimIMiLCJleHAiOjIzNDU2NywianRpIjoiZGUxMmY0ZTY3MDY4NDI3ODg5ZjE1YWMyNzcwZGEwNTEifQ.aEoAYkSJjoWH1boshQAaTkf8G3yn0kapko6HFRt7Rh4"
}
#HttpOnly_localhost FALSE / FALSE 1731614955 sessionid to8ut2q5l2t3trikm8zaq1yh9vstodyq
```

!!! important
Expand Down

0 comments on commit 73d6097

Please sign in to comment.