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