From be6a8c32c1a7bb9bbc07e068e9ba81ad0011dcda Mon Sep 17 00:00:00 2001 From: authcompanion Date: Thu, 12 Oct 2023 13:06:42 -0400 Subject: [PATCH] docs: add metadata field to API reference --- documentation/reference/adminapi.md | 4 +++- documentation/reference/authapi.md | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/documentation/reference/adminapi.md b/documentation/reference/adminapi.md index dbf8bec..ce9cf53 100644 --- a/documentation/reference/adminapi.md +++ b/documentation/reference/adminapi.md @@ -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: @@ -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 diff --git a/documentation/reference/authapi.md b/documentation/reference/authapi.md index 169cf01..927f7f1 100644 --- a/documentation/reference/authapi.md +++ b/documentation/reference/authapi.md @@ -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: @@ -28,7 +28,10 @@ a user with your backend APIs. "attributes": { "name": "Authy Person", "email": "hello@authcompanion.com", - "password": "mysecretpass" + "password": "mysecretpass", + "metadata": { + "tenant": "tenantID" + } } } } @@ -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 @@ -111,7 +116,10 @@ All fields in the user's attributes are optional. "attributes": { "name": "Authy Person_updated", "email": "hello@authcompanion.com", - "password": "mysecretpass" + "password": "mysecretpass", + "metadata": { + "tenant": "tenantID" + } } } }