Put proper token examples
This commit is contained in:
parent
23ac445713
commit
2891101286
2 changed files with 70 additions and 68 deletions
|
@ -8,12 +8,12 @@ Authenticates the user, and issues an access token for future requests.
|
|||
|
||||
## Request
|
||||
|
||||
|Name|Type|Description|
|
||||
|-|-|-|
|
||||
|identifier|string|User's gorb ID. One of identifier and email **must** be implemented|
|
||||
|email|string|User's email. One of identifier and email **must** be implemented|
|
||||
|password|string|**Required**: The user's password (we need to figure out how exactly we're hashing + salting it on the client)|
|
||||
|device_name|string|Name to help the user identify the device in their session list|
|
||||
| Name | Type | Description |
|
||||
| ----------- | ------ | -------------------------------------------------------------------------------------------------------------- |
|
||||
| identifier | string | User's gorb ID. One of identifier and email **must** be implemented |
|
||||
| email | string | User's email. One of identifier and email **must** be implemented |
|
||||
| password | string | **Required**: The user's password (we need to figure out how exactly we're hashing + salting it on the client) |
|
||||
| device_name | string | Name to help the user identify the device in their session list |
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -27,26 +27,27 @@ Authenticates the user, and issues an access token for future requests.
|
|||
|
||||
## Responses
|
||||
|
||||
|Status|Description|
|
||||
|-|-|
|
||||
|200|Authentication successful|
|
||||
|400|The post request included poorly formated data|
|
||||
|403|Part of the cridentials are invalid.|
|
||||
| Status | Description |
|
||||
| ------ | ---------------------------------------------- |
|
||||
| 200 | Authentication successful |
|
||||
| 400 | The post request included poorly formated data |
|
||||
| 403 | Part of the cridentials are invalid. |
|
||||
|
||||
---
|
||||
|
||||
### 200
|
||||
|
||||
|Name|Type|Description|
|
||||
|-|-|-|
|
||||
|access_token|string|**Required**: The access token that will be used for further authentication|
|
||||
|user_id|string|**Required**: The full gorb ID for the account|
|
||||
|expires_in|int|How many seconds until the token expires and is invalidated|
|
||||
| Name | Type | Description |
|
||||
| ------------ | ------ | --------------------------------------------------------------------------- |
|
||||
| access_token | string | **Required**: The access token that will be used for further authentication |
|
||||
| user_id | string | **Required**: The full gorb ID for the account |
|
||||
| expires_in | int | How many seconds until the token expires and is invalidated |
|
||||
|
||||
```json
|
||||
{
|
||||
"access_token": "gwLhWXD9wrqL3DwxXZ0VHUeOjr8am1yO",
|
||||
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJAcmFkaWFsXzQ3NDA6Z29yYi5hcHAiLCJpZGVudGlmaWVyIjoicmFkaWFsXzQ3NDAiLCJpYXQiOjE3NDM4ODgyNDAsImV4cCI6MTc0NTk2MTg0MH0.MZsOfeOm98K2sgtJ3hIDy0iyX27tDJRgW5iSayBJIDM",
|
||||
"user_id": "@radial_4740:gorb.app",
|
||||
"expires_in": 2592000
|
||||
"expires_in": 86400,
|
||||
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJAcmFkaWFsXzQ3NDA6Z29yYi5hcHAiLCJpZGVudGlmaWVyIjoicmFkaWFsXzQ3NDAiLCJpYXQiOjE3NDM4ODgyNDAsImV4cCI6MTc0NjQ4MDI0MH0.OvUDelrhELNBhizvAj7wm13YpDLYluI4sPeBmT5sPUg"
|
||||
}
|
||||
```
|
|
@ -8,12 +8,12 @@ Registers the user, and issues an access token for future requests.
|
|||
|
||||
## Request
|
||||
|
||||
|Name|Type|Description|
|
||||
|-|-|-|
|
||||
|identifier|string|**Required** User's desired ID|
|
||||
|email|string|**Required** User's email|
|
||||
|password|string|**Required**: The user's password (we need to figure out how exactly we're hashing + salting it on the client)|
|
||||
|device_name|string|Name to help the user identify the device in their session list|
|
||||
| Name | Type | Description |
|
||||
| ----------- | ------ | -------------------------------------------------------------------------------------------------------------- |
|
||||
| identifier | string | **Required** User's desired ID |
|
||||
| email | string | **Required** User's email |
|
||||
| password | string | **Required**: The user's password (we need to figure out how exactly we're hashing + salting it on the client) |
|
||||
| device_name | string | Name to help the user identify the device in their session list |
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -28,27 +28,28 @@ Registers the user, and issues an access token for future requests.
|
|||
|
||||
## Responses
|
||||
|
||||
|Status|Description|
|
||||
|-|-|
|
||||
|200|Registration successful|
|
||||
|400|The post request included poorly formated data|
|
||||
|401|Signups are disabled, gorb ID not available, email already in use, or password doesn't meet the minimum security requirements|
|
||||
| Status | Description |
|
||||
| ------ | ----------------------------------------------------------------------------------------------------------------------------- |
|
||||
| 200 | Registration successful |
|
||||
| 400 | The post request included poorly formated data |
|
||||
| 401 | Signups are disabled, gorb ID not available, email already in use, or password doesn't meet the minimum security requirements |
|
||||
|
||||
---
|
||||
|
||||
### 200
|
||||
|
||||
|Name|Type|Description|
|
||||
|-|-|-|
|
||||
|access_token|string|**Required**: The access token that will be used for further authentication|
|
||||
|user_id|string|**Required**: The full gorb ID for the account|
|
||||
|expires_in|int|How many seconds until the token expires and is invalidated|
|
||||
| Name | Type | Description |
|
||||
| ------------ | ------ | --------------------------------------------------------------------------- |
|
||||
| access_token | string | **Required**: The access token that will be used for further authentication |
|
||||
| user_id | string | **Required**: The full gorb ID for the account |
|
||||
| expires_in | int | How many seconds until the token expires and is invalidated |
|
||||
|
||||
```json
|
||||
{
|
||||
"access_token": "gwLhWXD9wrqL3DwxXZ0VHUeOjr8am1yO",
|
||||
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJAcmFkaWFsXzQ3NDA6Z29yYi5hcHAiLCJpZGVudGlmaWVyIjoicmFkaWFsXzQ3NDAiLCJpYXQiOjE3NDM4ODgyNDAsImV4cCI6MTc0NTk2MTg0MH0.MZsOfeOm98K2sgtJ3hIDy0iyX27tDJRgW5iSayBJIDM",
|
||||
"user_id": "@radial_4740:gorb.app",
|
||||
"expires_in": 2592000
|
||||
"expires_in": 86400,
|
||||
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJAcmFkaWFsXzQ3NDA6Z29yYi5hcHAiLCJpZGVudGlmaWVyIjoicmFkaWFsXzQ3NDAiLCJpYXQiOjE3NDM4ODgyNDAsImV4cCI6MTc0NjQ4MDI0MH0.OvUDelrhELNBhizvAj7wm13YpDLYluI4sPeBmT5sPUg"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -56,17 +57,17 @@ Registers the user, and issues an access token for future requests.
|
|||
|
||||
### 401
|
||||
|
||||
|Name|Type|Description|
|
||||
|-|-|-|
|
||||
|signups_enabled|bool|Does the server have signups enabled?|
|
||||
|gorb_id_valid|bool|Is the given gorb ID even valid?|
|
||||
|gorb_id_available|bool|Is the given gorb ID available?|
|
||||
|email_valid|bool|Is the given email valid?|
|
||||
|email_available|bool|Is the given email available?|
|
||||
|password_minimum_length|bool|Is the given password long enough?|
|
||||
|password_special_characters|bool|If enforced by the server, is there enough special characters in the password?|
|
||||
|password_letters|bool|If enforced by the server, is there enough letters in the password?|
|
||||
|password_numbers|bool|If enforced by the server, is there enough numbers in the password?|
|
||||
| Name | Type | Description |
|
||||
| --------------------------- | ---- | ------------------------------------------------------------------------------ |
|
||||
| signups_enabled | bool | Does the server have signups enabled? |
|
||||
| gorb_id_valid | bool | Is the given gorb ID even valid? |
|
||||
| gorb_id_available | bool | Is the given gorb ID available? |
|
||||
| email_valid | bool | Is the given email valid? |
|
||||
| email_available | bool | Is the given email available? |
|
||||
| password_minimum_length | bool | Is the given password long enough? |
|
||||
| password_special_characters | bool | If enforced by the server, is there enough special characters in the password? |
|
||||
| password_letters | bool | If enforced by the server, is there enough letters in the password? |
|
||||
| password_numbers | bool | If enforced by the server, is there enough numbers in the password? |
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -78,6 +79,6 @@ Registers the user, and issues an access token for future requests.
|
|||
"password_minimum_length": true,
|
||||
"password_special_characters": false,
|
||||
"password_letters": true,
|
||||
"password_numbers": true,
|
||||
"password_numbers": true
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue