You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move auth docs to /docs/platform/auth and update navigation
- Move 8 auth MDX files from /docs/auth/ to /docs/platform/auth/
- Add redirect_from entries for all old /docs/auth/* paths
- Add Authentication section to Platform nav (with nested Token auth)
- Remove Authentication section from Pub/Sub nav
- Update cross-references within auth files to new paths
- Fix relative image paths for new directory depth
Copy file name to clipboardExpand all lines: src/pages/docs/platform/auth/basic.mdx
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
1
---
2
2
title: Basic auth
3
3
meta_description: "Basic authentication allows you to authenticate a secure server using an Ably API key and secret."
4
+
redirect_from:
5
+
- /docs/auth/basic
4
6
---
5
7
6
-
Basic authentication is the simplest way to authenticate with Ably. It requires passing an [API key](/docs/auth#api-key) when instancing an SDK.
8
+
Basic authentication is the simplest way to authenticate with Ably. It requires passing an [API key](/docs/platform/auth#api-key) when instancing an SDK.
7
9
8
10
<Asidedata-type='important'>
9
11
Private API keys should never be shared with untrusted parties, and as such, should only be used by your trusted secure servers when authenticating with Ably.
@@ -115,14 +117,14 @@ $rest = new Ably\AblyRest(['key' => '{{API_KEY}}']);
115
117
116
118
The process used by Ably SDKs to authenticate with Ably using basic authentication is illustrated in the following diagram:
117
119
118
-

120
+

119
121
120
122
## When to use basic auth <aid="when"/>
121
123
122
124
Ably recommends that basic authentication is only used server-side because of the following potential issues:
123
125
124
126
* The secret is passed directly by the client to Ably, so it is only permitted for connections that are over TLS, to prevent the key secret being intercepted.
125
-
* All of the configured [capabilities](/docs/auth/capabilities) of the key are implicitly possible in any request, and clients that legitimately obtain this key may then abuse the rights for that key.
127
+
* All of the configured [capabilities](/docs/platform/auth/capabilities) of the key are implicitly possible in any request, and clients that legitimately obtain this key may then abuse the rights for that key.
126
128
* A client that authenticates using an API key can claim any client ID it chooses. Therefore this client ID cannot be trusted to represent the genuine identity of the client. Client IDs should be assigned by the server, once the client's credentials have been authenticated.
Copy file name to clipboardExpand all lines: src/pages/docs/platform/auth/capabilities.mdx
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,25 @@
1
1
---
2
2
title: Capabilities
3
3
meta_description: "Capabilities define which operations can be carried out on which channels by a client."
4
+
redirect_from:
5
+
- /docs/auth/capabilities
4
6
---
5
7
6
8
API keys and Ably-compatible tokens, have a set of capabilities assigned to them that specify which operations (such as subscribe or publish) can be performed on which channels.
7
9
8
10
API keys are long-lived, secret and typically not shared with clients. API key capabilities are configured using the [dashboard](https://ably.com/dashboard), or using the [Control API](/docs/platform/account/control-api).
9
11
10
-
Ably-compatible tokens are designed to be shared with untrusted clients, are short-lived, and can be configured and issued programmatically. For restricting client access to channels, tokens provide far more flexibility and security than API key capabilities. See [selecting an authentication mechanism](/docs/auth#selecting-auth) to understand why token authentication is the preferred option in most scenarios.
12
+
Ably-compatible tokens are designed to be shared with untrusted clients, are short-lived, and can be configured and issued programmatically. For restricting client access to channels, tokens provide far more flexibility and security than API key capabilities. See [selecting an authentication mechanism](/docs/platform/auth#selecting-auth) to understand why token authentication is the preferred option in most scenarios.
11
13
12
14
### Capability changes and existing connections <aid="capability-changes-existing-connections"/>
13
15
14
16
<Asidedata-type='important'>
15
17
When you change a key's capabilities in the dashboard, existing connections using that key do **not** receive the updated capabilities immediately. Connections must be closed and re-opened to pick up the new capabilities.
16
18
</Aside>
17
19
18
-
Once created, it's best to think of keys and tokens as being immutable. To modify the permissions granted to existing connections, the recommended approach is to use [token authentication](/docs/auth/token) and issue the client a new token with the updated permissions you want them to have.
20
+
Once created, it's best to think of keys and tokens as being immutable. To modify the permissions granted to existing connections, the recommended approach is to use [token authentication](/docs/platform/auth/token) and issue the client a new token with the updated permissions you want them to have.
19
21
20
-
The one exception is if a key is revoked entirely, in which case all connections using that key (or a token derived from that key) will be forcibly terminated. See [token revocation](/docs/auth/revocation) for more information.
22
+
The one exception is if a key is revoked entirely, in which case all connections using that key (or a token derived from that key) will be forcibly terminated. See [token revocation](/docs/platform/auth/revocation) for more information.
21
23
22
24
## Resource names and wildcards <aid="wildcards"/>
23
25
@@ -71,7 +73,7 @@ Ably does not provide numeric limits on channel access. Control channel access u
71
73
72
74
Channel access is controlled through:
73
75
74
-
*[Token authentication](/docs/auth/token) to restrict access by issuing tokens with specific capabilities to authorized users.
76
+
*[Token authentication](/docs/platform/auth/token) to restrict access by issuing tokens with specific capabilities to authorized users.
75
77
* Specific `clientId` values in tokens to ensure only certain users can access particular channels.
76
78
* Granting or restricting specific operations (`subscribe`, `publish`, `presence`) on channels through capability configurations.
77
79
@@ -87,7 +89,7 @@ Channel mode flags offer the ability for clients to use different capabilities f
87
89
88
90
## API key capabilities <aid="capabilities-key"/>
89
91
90
-
An [Ably API key](/docs/auth#api-key) can have a single set of permissions, applied to any number of [channels](/docs/channels) or [queues](/docs/platform/integrations/queues).
92
+
An [Ably API key](/docs/platform/auth#api-key) can have a single set of permissions, applied to any number of [channels](/docs/channels) or [queues](/docs/platform/integrations/queues).
91
93
92
94
You can also choose whether to restrict the API key to only channels, only [queues](/docs/platform/integrations/queues), or to match a set of channel or queue names. If you've chosen to restrict the API key to *selected channels and queues*, you can use a comma separated list of resources the API key can access, making use of wildcards to provide access to areas of your app. It is worth noting an API key will provide the same permissions to all resources it has access to.
93
95
@@ -358,7 +360,7 @@ Note that a successful token request doesn't guarantee all requested capabilitie
358
360
359
361
#### Ably Token without capabilities <aid="ably-token-all"/>
360
362
361
-
If no capability is specified in an Ably `TokenRequest`, then the [Ably Token](/docs/auth/token/ably-tokens) will be given the full set of capabilities assigned to the issuing key.
363
+
If no capability is specified in an Ably `TokenRequest`, then the [Ably Token](/docs/platform/auth/token/ably-tokens) will be given the full set of capabilities assigned to the issuing key.
362
364
363
365
Using the following example, an API key exists with the listed capabilities. If an Ably Token is requested without specifying any capabilities then the `TokenRequest` is treated as requesting all capabilities, i.e. `{"[*]*":["*"]}`. This will result in the Ably Token receiving all the capabilities of the API key.
364
366
@@ -435,7 +437,7 @@ if err != nil {
435
437
436
438
If a set of capabilities are requested, then the Ably Token will be assigned the intersection of the requested capability and the capability of the issuing key.
437
439
438
-
Using the following example, an API key exists with the listed capabilities. If an [Ably Token](/docs/auth/token/ably-tokens) is requested and specifies a set of capabilities, then the resulting token will only receive those capabilities that intersect. The capabilities of a token cannot exceed those of the issuing API key.
440
+
Using the following example, an API key exists with the listed capabilities. If an [Ably Token](/docs/platform/auth/token/ably-tokens) is requested and specifies a set of capabilities, then the resulting token will only receive those capabilities that intersect. The capabilities of a token cannot exceed those of the issuing API key.
439
441
440
442
<Code>
441
443
```javascript
@@ -533,7 +535,7 @@ if err != nil {
533
535
534
536
If a set of capabilities are requested, and the intersection between those and the API key's capabilities is empty, then the `TokenRequest` will result in an error.
535
537
536
-
Using the following example, an API key exists with the listed capabilities. If an [Ably Token](/docs/auth/token/ably-tokens) is requested that specifies a set of capabilities, and there is no intersection between the capabilities of the issuing API key and requested token, then the token request will be rejected. In the following example, the callback will be returned with an error.
538
+
Using the following example, an API key exists with the listed capabilities. If an [Ably Token](/docs/platform/auth/token/ably-tokens) is requested that specifies a set of capabilities, and there is no intersection between the capabilities of the issuing API key and requested token, then the token request will be rejected. In the following example, the callback will be returned with an error.
Capabilities are determined for [JWTs](/docs/auth/token/jwt) in the following way:
600
+
Capabilities are determined for [JWTs](/docs/platform/auth/token/jwt) in the following way:
599
601
600
602
* The capabilities granted to an Ably JWT will be the intersection of the capabilities within the Ably JWT and the capabilities of the associated API key.
601
603
* If the set of capabilities within the Ably JWT have no intersection with the capabilities of the API key, then an error will instead be returned.
602
604
603
605
## Channel-scoped user claims <aid="custom-restrictions"/>
604
606
605
-
JWTs can contain channel-scoped user claims for trusted metadata that other clients can read. See [JWT authentication — channel-scoped claims](/docs/auth/token/jwt#channel-claims) for details and examples.
607
+
JWTs can contain channel-scoped user claims for trusted metadata that other clients can read. See [JWT authentication — channel-scoped claims](/docs/platform/auth/token/jwt#channel-claims) for details and examples.
JWTs can specify per-connection publish rate limits to restrict how many messages a client can send. See [JWT authentication — rate limits](/docs/auth/token/jwt#rate-limits) for details and examples.
611
+
JWTs can specify per-connection publish rate limits to restrict how many messages a client can send. See [JWT authentication — rate limits](/docs/platform/auth/token/jwt#rate-limits) for details and examples.
Copy file name to clipboardExpand all lines: src/pages/docs/platform/auth/identified-clients.mdx
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
---
2
2
title: Identified clients
3
3
meta_description: "Clients can be allocated a client ID to help control their operations and interactions with Ably channels."
4
+
redirect_from:
5
+
- /docs/auth/identified-clients
4
6
---
5
7
6
8
When a client is authenticated and connected to Ably, it is considered to be an authenticated client. While an authenticated client has a means to authenticate with Ably, they do not necessarily have an identity.
@@ -33,18 +35,18 @@ There are three different ways a client can be identified with using a `clientId
33
35
When a client sets their own ID there is the possibility that they can pretend to be someone else. To prevent this, it is recommended that you embed a `clientId` in the token issued to your clients from your auth server. This ensures that the `clientId` is set by your auth server, and eliminates the chance of a client pretending to be someone else.
34
36
35
37
<Asidedata-type='note'>
36
-
Identifying a client varies depending on whether they are authenticating with basic authentication or token authentication. Token authentication is [recommended](/docs/auth#selecting-auth) in most instances so that clients authenticate using short-lived tokens and do not have access to API keys.
38
+
Identifying a client varies depending on whether they are authenticating with basic authentication or token authentication. Token authentication is [recommended](/docs/platform/auth#selecting-auth) in most instances so that clients authenticate using short-lived tokens and do not have access to API keys.
37
39
38
40
Since you then control the `clientId`, all other clients can rely on the validity of the `clientId` in published messages and of members present in presence channels. This eliminates the possibility of a client pretending to be someone else, as they cannot claim a `clientId` in their own.
39
41
</Aside>
40
42
41
43
### Basic auth <aid="basic"/>
42
44
43
-
You can use [basic authentication](/docs/auth/basic) to allow a client to claim any `clientId` when they authenticate with Ably. As the assignation of the `clientId` is not handled by a server, it cannot be trusted to represent the genuine identity of the client.
45
+
You can use [basic authentication](/docs/platform/auth/basic) to allow a client to claim any `clientId` when they authenticate with Ably. As the assignation of the `clientId` is not handled by a server, it cannot be trusted to represent the genuine identity of the client.
44
46
45
47
### Token auth <aid="token"/>
46
48
47
-
You can use [token authentication](/docs/auth/token) to set an explicit `clientId` when creating or issuing a token. Clients using that token are restricted to operations for only that `clientId`, and all operations will implicitly contain that `clientId`.
49
+
You can use [token authentication](/docs/platform/auth/token) to set an explicit `clientId` when creating or issuing a token. Clients using that token are restricted to operations for only that `clientId`, and all operations will implicitly contain that `clientId`.
48
50
49
51
For example, when publishing a message, the `clientId` attribute of the message will be pre-populated with that `clientId`. Entering presence will also implicitly use that `clientId`.
50
52
@@ -56,7 +58,7 @@ To set a `clientId` in a JWT, include the `x-ably-clientId` claim in the JWT pay
56
58
| --- | --- |
57
59
|`x-ably-clientId`| The `clientId` to assign to the client (for example, `user-123`). |
58
60
59
-
See [JWT authentication](/docs/auth/token/jwt#scenario-standard) for complete server and client examples in all supported languages.
61
+
See [JWT authentication](/docs/platform/auth/token/jwt#scenario-standard) for complete server and client examples in all supported languages.
60
62
61
63
#### Using TokenRequest <aid="tokenrequest-clientid"/>
62
64
@@ -129,8 +131,8 @@ final tokenRequest = rest.auth.createTokenRequest(
129
131
130
132
### Wildcard token auth <aid="wildcard"/>
131
133
132
-
You can use [token authentication](/docs/auth/token) to set a wildcard `clientId` using a value of `*` when creating a token. Clients are then able to assume any identity in their operations, such as when publishing a message or entering presence.
134
+
You can use [token authentication](/docs/platform/auth/token) to set a wildcard `clientId` using a value of `*` when creating a token. Clients are then able to assume any identity in their operations, such as when publishing a message or entering presence.
133
135
134
136
## Unidentified clients <aid="unidentified"/>
135
137
136
-
If no `clientId` is provided when using [token authentication](/docs/auth/token) then clients are not permitted to assume an identity and will be considered an unidentified client in all operations. Messages published will contain no `clientId` and those clients will not be permitted to enter the [presence](/docs/presence-occupancy/presence) set.
138
+
If no `clientId` is provided when using [token authentication](/docs/platform/auth/token) then clients are not permitted to assume an identity and will be considered an unidentified client in all operations. Messages published will contain no `clientId` and those clients will not be permitted to enter the [presence](/docs/presence-occupancy/presence) set.
0 commit comments