2019-05-09 18:54:39 +12:00
|
|
|
# Auth Service
|
|
|
|
|
|
|
|
## Login User
|
|
|
|
|
|
|
|
```http request
|
2019-10-09 17:16:38 +13:00
|
|
|
POST https://appwrite.io/v1/auth/login
|
2019-05-09 18:54:39 +12:00
|
|
|
```
|
|
|
|
|
2019-10-09 17:16:38 +13:00
|
|
|
** /docs/references/auth/login.md **
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
| Field Name | Type | Description | Default |
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
| email | string | User account email address | |
|
|
|
|
| password | string | User account password | |
|
|
|
|
| success | string | URL to redirect back to your app after a successful login attempt. | |
|
|
|
|
| failure | string | URL to redirect back to your app after a failed login attempt. | |
|
|
|
|
|
|
|
|
## Logout Current Session
|
|
|
|
|
|
|
|
```http request
|
2019-10-09 17:16:38 +13:00
|
|
|
DELETE https://appwrite.io/v1/auth/logout
|
2019-05-09 18:54:39 +12:00
|
|
|
```
|
|
|
|
|
2019-10-09 17:16:38 +13:00
|
|
|
** /docs/references/auth/logout.md **
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
## Logout Specific Session
|
|
|
|
|
|
|
|
```http request
|
2019-10-09 17:16:38 +13:00
|
|
|
DELETE https://appwrite.io/v1/auth/logout/{id}
|
2019-05-09 18:54:39 +12:00
|
|
|
```
|
|
|
|
|
2019-10-09 17:16:38 +13:00
|
|
|
** /docs/references/auth/logout-by-session.md **
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
| Field Name | Type | Description | Default |
|
|
|
|
| --- | --- | --- | --- |
|
2019-07-21 23:54:45 +12:00
|
|
|
| id | string | **Required** User specific session unique ID number. if 0 delete all sessions. | |
|
2019-05-09 18:54:39 +12:00
|
|
|
|
2019-09-04 01:40:42 +12:00
|
|
|
## OAuth Login
|
|
|
|
|
|
|
|
```http request
|
2019-10-09 17:16:38 +13:00
|
|
|
GET https://appwrite.io/v1/auth/oauth/{provider}
|
2019-09-04 01:40:42 +12:00
|
|
|
```
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
| Field Name | Type | Description | Default |
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
| provider | string | **Required** OAuth Provider | |
|
|
|
|
| success | string | URL to redirect back to your app after a successful login attempt. | |
|
|
|
|
| failure | string | URL to redirect back to your app after a failed login attempt. | |
|
|
|
|
|
2019-05-09 18:54:39 +12:00
|
|
|
## Password Recovery
|
|
|
|
|
|
|
|
```http request
|
2019-10-09 17:16:38 +13:00
|
|
|
POST https://appwrite.io/v1/auth/recovery
|
2019-05-09 18:54:39 +12:00
|
|
|
```
|
|
|
|
|
2019-10-09 17:16:38 +13:00
|
|
|
** /docs/references/auth/recovery.md **
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
| Field Name | Type | Description | Default |
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
| email | string | User account email address. | |
|
2019-10-02 07:10:33 +13:00
|
|
|
| reset | string | Reset URL in your app to redirect the user after the reset token has been sent to the user email. | |
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
## Password Reset
|
|
|
|
|
|
|
|
```http request
|
2019-10-09 17:16:38 +13:00
|
|
|
PUT https://appwrite.io/v1/auth/recovery/reset
|
2019-05-09 18:54:39 +12:00
|
|
|
```
|
|
|
|
|
2019-10-09 17:16:38 +13:00
|
|
|
** /docs/references/auth/recovery-reset.md **
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
| Field Name | Type | Description | Default |
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
| userId | string | User account email address. | |
|
|
|
|
| token | string | Valid reset token. | |
|
|
|
|
| password-a | string | New password. | |
|
|
|
|
| password-b | string | New password again. | |
|
|
|
|
|
|
|
|
## Register User
|
|
|
|
|
|
|
|
```http request
|
2019-10-09 17:16:38 +13:00
|
|
|
POST https://appwrite.io/v1/auth/register
|
2019-05-09 18:54:39 +12:00
|
|
|
```
|
|
|
|
|
2019-10-09 17:16:38 +13:00
|
|
|
** /docs/references/auth/register.md **
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
| Field Name | Type | Description | Default |
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
| email | string | Account email | |
|
|
|
|
| password | string | User password | |
|
2019-10-02 07:10:33 +13:00
|
|
|
| confirm | string | Confirmation URL to redirect user after confirm token has been sent to user email | |
|
2019-05-09 18:54:39 +12:00
|
|
|
| success | string | Redirect when registration succeed | |
|
|
|
|
| failure | string | Redirect when registration failed | |
|
2019-09-20 18:33:11 +12:00
|
|
|
| name | string | User name | |
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
## Confirm User
|
|
|
|
|
|
|
|
```http request
|
2019-10-09 17:16:38 +13:00
|
|
|
POST https://appwrite.io/v1/auth/register/confirm
|
2019-05-09 18:54:39 +12:00
|
|
|
```
|
|
|
|
|
2019-10-09 17:16:38 +13:00
|
|
|
** /docs/references/auth/confirm.md **
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
| Field Name | Type | Description | Default |
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
| userId | string | User unique ID | |
|
|
|
|
| token | string | Confirmation secret token | |
|
|
|
|
|
|
|
|
## Resend Confirmation
|
|
|
|
|
|
|
|
```http request
|
2019-10-09 17:16:38 +13:00
|
|
|
POST https://appwrite.io/v1/auth/register/confirm/resend
|
2019-05-09 18:54:39 +12:00
|
|
|
```
|
|
|
|
|
2019-10-09 17:16:38 +13:00
|
|
|
** /docs/references/auth/confirm-resend.md **
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
| Field Name | Type | Description | Default |
|
|
|
|
| --- | --- | --- | --- |
|
2019-10-02 07:10:33 +13:00
|
|
|
| confirm | string | Confirmation URL to redirect user to your app after confirm token has been sent to user email. | |
|
2019-10-04 06:58:18 +13:00
|
|
|
|