Skip to content

Commit

Permalink
Update authentication.md
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Léobal <[email protected]>
  • Loading branch information
oleobal committed Aug 8, 2023
1 parent ff3af91 commit 89bb9b1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ curl \
--header 'Content-Type: application/json' \
--data '{"username":"org-1","password":"p@sswr0d44"}' \
http://substra-backend.org-1.com/api-token-auth/
{"expires_at":"<ISO timestamp>","created_at":"<ISO timestamp>","token":"<auth_token_value>"}
{"expires_at":"<ISO timestamp>","created_at":"<ISO timestamp>","token":"<auth_token_value>","id":"<UUID>"}
```

2. Show all existing token
Expand All @@ -90,7 +90,7 @@ curl \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <auth_token_value>' \
'http://substra-backend.org-1.com:8000/active-api-tokens/'
{"tokens": {"id": "<uuid4 id>", "note": "<string>", "expires_at":"<ISO timestamp>", "created_at":"<ISO timestamp>"}, "implicit_token":{"expires_at":"<ISO timestamp>", "created_at":"<ISO timestamp>"}}
{"tokens": {"id": "<UUID>", "note": "<string>", "expires_at":"<ISO timestamp>", "created_at":"<ISO timestamp>"}, "implicit_tokens":[{"expires_at":"<ISO timestamp>", "created_at":"<ISO timestamp>","id":"<UUID>"}]}
```

3. Create a new token using token authentication ("expires_at" must be null or DDDD-MM-YY)
Expand All @@ -105,7 +105,7 @@ curl --request POST \
{"id": "<uuid4 id>", "note": "<string>", "expires_at":"<ISO timestamp or null>", "created_at":"<ISO timestamp>, "token":"<auth_token_value>}
```

4. Fetch any asset with the authentication token in the header.
4. Fetch any asset with the authentication token in the header

```bash
curl \
Expand All @@ -115,6 +115,13 @@ curl \
{"host":"http://testserver","organization_id":"MyOrg1MSP","organization_name":"OrgTestSuite","config":{"model_export_enabled":false},"auth":{},"channel":"mychannel","version":"dev","orchestrator_version":null,"user":"org-1","user_role":"ADMIN"}
```

5. Delete a token

``` bash
curl -X DELETE --header 'Authorization: Token <auth_token_value>' http://substra-backend.org-1.com/active-api-tokens/?id=<UUID>
{"message":"Token removed"}
```

### Bearer tokens when already authenticated

- URL: `/api-token/`
Expand Down

0 comments on commit 89bb9b1

Please sign in to comment.