Skip to content

Commit

Permalink
docs: add metadata field to API reference
Browse files Browse the repository at this point in the history
  • Loading branch information
authcompanion committed Oct 12, 2023
1 parent 7f85566 commit be6a8c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 3 additions & 1 deletion documentation/reference/adminapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Description: Creates a new user in the Authcompanion database.

Bearer Token Required: `Authorization: Bearer {admin access token}`

Pass an arbitrary object to data.attributes.metdata which will be made availale as a claim on the user's JWT issued after login.
Pass an arbitrary object to data.attributes.metdata which will be made available as a claim on the user's JWT issued after login.

**POST** Request Body:

Expand Down Expand Up @@ -168,6 +168,8 @@ Description: Updates a single user from the Authcompanion database with the user

Bearer Token Required: `Authorization: Bearer {admin access token}`

Pass an arbitrary object to data.attributes.metdata which will be made available as a claim on the user's JWT issued after login.

**PATCH** Request Body:

```json
Expand Down
18 changes: 13 additions & 5 deletions documentation/reference/authapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Returns Content-Type: application/json

### auth/register

Description: Register a user. Returns a JWT access token and sets a refresh
token (as a http only cookie). JWTs are used by your web application to authenticate
a user with your backend APIs.
Description: Register a user. Returns a JWT access token and sets a refresh token (as a http only cookie). JWTs are used by your web application to authenticate a user with your backend APIs.

Optional: Pass an arbitrary object to data.attributes.metdata which will be made available as a claim on the user's JWT issued after login.

**POST** Request Body:

Expand All @@ -28,7 +28,10 @@ a user with your backend APIs.
"attributes": {
"name": "Authy Person",
"email": "[email protected]",
"password": "mysecretpass"
"password": "mysecretpass",
"metadata": {
"tenant": "tenantID"
}
}
}
}
Expand Down Expand Up @@ -102,6 +105,8 @@ Bearer Token Required: `Authorization: Bearer {user's access token}`

All fields in the user's attributes are optional.

Pass an arbitrary object to data.attributes.metdata which will be made available as a claim on the user's JWT issued after login.

**POST** Request Body:

```json
Expand All @@ -111,7 +116,10 @@ All fields in the user's attributes are optional.
"attributes": {
"name": "Authy Person_updated",
"email": "[email protected]",
"password": "mysecretpass"
"password": "mysecretpass",
"metadata": {
"tenant": "tenantID"
}
}
}
}
Expand Down

0 comments on commit be6a8c3

Please sign in to comment.