Skip to content

Commit 2c1dad5

Browse files
committed
docs: remove usage examples from Pexip auth credentials doc
Keep only the API reference — Pexip team can refer to RC server docs for iframe authentication methods.
1 parent 42b575d commit 2c1dad5

File tree

1 file changed

+4
-50
lines changed

1 file changed

+4
-50
lines changed

docs/pexip-auth-credentials.md

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -39,60 +39,14 @@ getAuthCredentials(): Promise<{
3939

4040
**Response fields:**
4141

42-
| Field | Type | Description |
43-
|-------|------|-------------|
44-
| `userId` | `string` | The Rocket.Chat user ID of the logged-in user |
45-
| `authToken` | `string` | The Meteor login token (session token) for the user |
42+
| Field | Type | Description |
43+
| ----------- | -------- | ----------------------------------------------------------------------- |
44+
| `userId` | `string` | The Rocket.Chat user ID of the logged-in user |
45+
| `authToken` | `string` | The Meteor login token (session token) for the user |
4646
| `serverUrl` | `string` | The origin of the Rocket.Chat server (e.g., `https://chat.example.com`) |
4747

4848
Returns `null` if credentials are not available.
4949

50-
**Example usage:**
51-
52-
```javascript
53-
const credentials = await window.videoCallWindow.getAuthCredentials();
54-
if (credentials) {
55-
const { userId, authToken, serverUrl } = credentials;
56-
57-
// Option A: Append resumeToken to the iframe URL
58-
const iframeSrc = `${serverUrl}/channel/room-id?layout=embedded&resumeToken=${authToken}`;
59-
60-
// Option B: Use Rocket.Chat's postMessage API after iframe loads
61-
// (requires Iframe_Integration_receive_enable=true on the RC server)
62-
iframe.contentWindow.postMessage({
63-
externalCommand: 'login-with-token',
64-
token: authToken,
65-
}, serverUrl);
66-
}
67-
```
68-
69-
## Authentication Options for the RC Iframe
70-
71-
The `authToken` returned is a standard Meteor login token. Two approaches can be used to authenticate the embedded Rocket.Chat iframe:
72-
73-
### Option A: `resumeToken` URL Parameter
74-
75-
Append `?resumeToken=TOKEN` to the iframe URL. Rocket.Chat will automatically log the user in and remove the token from the URL.
76-
77-
```
78-
https://chat.example.com/channel/room-id?layout=embedded&resumeToken=AUTH_TOKEN
79-
```
80-
81-
This works without any special server configuration.
82-
83-
### Option B: `postMessage` Command
84-
85-
After the iframe loads, send a postMessage to trigger login:
86-
87-
```javascript
88-
iframe.contentWindow.postMessage({
89-
externalCommand: 'login-with-token',
90-
token: authToken,
91-
}, serverUrl);
92-
```
93-
94-
This requires the Rocket.Chat server setting **Iframe_Integration_receive_enable** to be set to `true`.
95-
9650
## Multi-Workspace Support
9751

9852
The credentials are always captured from the specific Rocket.Chat workspace that initiated the video call. If the user is connected to multiple workspaces, the correct `userId`, `authToken`, and `serverUrl` for the calling workspace are returned.

0 commit comments

Comments
 (0)