This repository has been archived by the owner on Jun 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f150201
commit ada5f14
Showing
2 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
19 changes: 13 additions & 6 deletions
19
reference/api/rest-api/endpoints/authentication-endpoints/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
# Authentication | ||
|
||
To access the Rocket.Chat API, you need to log in using your `username` and `password`. This authentication method allows you to interact securely with the Rocket.Chat server and perform actions on behalf of the authenticated user. | ||
Rocket.Chat provides diverse authentication methods for secure API communication, spanning from basic [username and password authentication](login.md) to OAuth integration with services such as [Google](google.md), [Facebook](facebook.md), and [Twitter](twitter.md). | ||
|
||
Upon successful authentication, the API will provide an authentication token (`authToken`) and a unique user identifier (`userId`) as part of the JSON response. These values should be used as headers in subsequent requests to protected endpoints that require authentication. | ||
To access protected endpoints in the Rocket.Chat API, you must include the userId and a valid authentication token of the user as headers in the request. Add the authentication token as `x-Auth-Token` and the userId as `x-User-Id` in the headers of your request. | ||
|
||
{% hint style="info" %} | ||
The `authToken`is passed as `X-Auth-Token` header, while the `userId` as `X-User-Id` header. | ||
{% endhint %} | ||
#### Authentication Tokens | ||
|
||
The Rocket.Chat API also supports other forms of authentication using OAuth apps like [Facebook](facebook.md), [Google](google.md), and [Twitter](twitter.md). Go to the subsequent endpoint topics to know more. | ||
Authentication tokens are unique identifiers confirming a user's active session within your Rocket.Chat workspace. These tokens validate the user's identity and permissions, providing secure access to various features and resources. When making requests to protected endpoints that mandate authentication, add this authentication token as `x-Auth-Token` header in your request. | ||
|
||
In Rocket.Chat, there are primarily two types of authentication tokens: **authToken** and **personal access token**. | ||
|
||
1. **authToken** | ||
|
||
`authToken` is a temporary authentication token returned to users after a successful login through any login endpoint. Additionally, workspace administrators can create `authtoken` for a user via the [Create User Token](../user-management/users-endpoints/create-users-token.md) endpoint. | ||
2. **personal access token** | ||
|
||
[Personal Access Tokens](https://docs.rocket.chat/use-rocket.chat/user-guides/user-panel/account#personal-access-tokens) are permanent authentication tokens that users can generate for themselves to access the API securely without exposing their primary credentials. Visit the [Generate Personal Access Tokens API guide](../user-management/users-endpoints/generatepersonalaccesstoken.md) for more details. |
2 changes: 1 addition & 1 deletion
2
...ce/api/rest-api/endpoints/user-management/users-endpoints/create-users-token.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters