Skip to content

Commit 631840d

Browse files
committed
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
1 parent 2efff72 commit 631840d

File tree

10 files changed

+123
-108
lines changed

10 files changed

+123
-108
lines changed

src/data/nav/platform.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,50 @@ export default {
331331
},
332332
],
333333
},
334+
{
335+
name: 'Authentication',
336+
pages: [
337+
{
338+
name: 'Overview',
339+
link: '/docs/platform/auth',
340+
index: true,
341+
},
342+
{
343+
name: 'Basic auth',
344+
link: '/docs/platform/auth/basic',
345+
},
346+
{
347+
name: 'Token auth',
348+
pages: [
349+
{
350+
name: 'Overview',
351+
link: '/docs/platform/auth/token',
352+
index: true,
353+
},
354+
{
355+
name: 'JWTs',
356+
link: '/docs/platform/auth/token/jwt',
357+
},
358+
{
359+
name: 'Ably Tokens',
360+
link: '/docs/platform/auth/token/ably-tokens',
361+
},
362+
],
363+
},
364+
{
365+
name: 'Token revocation',
366+
link: '/docs/platform/auth/revocation',
367+
},
368+
{
369+
name: 'Identified clients',
370+
link: '/docs/platform/auth/identified-clients',
371+
},
372+
{
373+
name: 'Capabilities',
374+
link: '/docs/platform/auth/capabilities',
375+
},
376+
],
377+
},
334378
{
335379
name: 'Tools',
336380
pages: [

src/data/nav/pubsub.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -83,50 +83,6 @@ export default {
8383
},
8484
],
8585
},
86-
{
87-
name: 'Authentication',
88-
pages: [
89-
{
90-
name: 'Overview',
91-
link: '/docs/auth',
92-
index: true,
93-
},
94-
{
95-
name: 'Basic auth',
96-
link: '/docs/auth/basic',
97-
},
98-
{
99-
name: 'Token auth',
100-
pages: [
101-
{
102-
name: 'Overview',
103-
link: '/docs/auth/token',
104-
index: true,
105-
},
106-
{
107-
name: 'JWTs',
108-
link: '/docs/auth/token/jwt',
109-
},
110-
{
111-
name: 'Ably Tokens',
112-
link: '/docs/auth/token/ably-tokens',
113-
},
114-
],
115-
},
116-
{
117-
name: 'Token revocation',
118-
link: '/docs/auth/revocation',
119-
},
120-
{
121-
name: 'Identified clients',
122-
link: '/docs/auth/identified-clients',
123-
},
124-
{
125-
name: 'Capabilities',
126-
link: '/docs/auth/capabilities',
127-
},
128-
],
129-
},
13086
{
13187
name: 'Connections',
13288
pages: [
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
title: Basic auth
33
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
46
---
57

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.
79

810
<Aside data-type='important'>
911
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}}']);
115117

116118
The process used by Ably SDKs to authenticate with Ably using basic authentication is illustrated in the following diagram:
117119

118-
![Basic authentication process diagram](../../../images/content/diagrams/Ably-API-Auth1.png)
120+
![Basic authentication process diagram](../../../../images/content/diagrams/Ably-API-Auth1.png)
119121

120122
## When to use basic auth <a id="when"/>
121123

122124
Ably recommends that basic authentication is only used server-side because of the following potential issues:
123125

124126
* 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.
126128
* 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.
127129

128130
<Aside data-type='note'>

src/pages/docs/auth/capabilities.mdx renamed to src/pages/docs/platform/auth/capabilities.mdx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
---
22
title: Capabilities
33
meta_description: "Capabilities define which operations can be carried out on which channels by a client."
4+
redirect_from:
5+
- /docs/auth/capabilities
46
---
57

68
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.
79

810
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).
911

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.
1113

1214
### Capability changes and existing connections <a id="capability-changes-existing-connections"/>
1315

1416
<Aside data-type='important'>
1517
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.
1618
</Aside>
1719

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.
1921

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.
2123

2224
## Resource names and wildcards <a id="wildcards"/>
2325

@@ -71,7 +73,7 @@ Ably does not provide numeric limits on channel access. Control channel access u
7173

7274
Channel access is controlled through:
7375

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.
7577
* Specific `clientId` values in tokens to ensure only certain users can access particular channels.
7678
* Granting or restricting specific operations (`subscribe`, `publish`, `presence`) on channels through capability configurations.
7779

@@ -87,7 +89,7 @@ Channel mode flags offer the ability for clients to use different capabilities f
8789

8890
## API key capabilities <a id="capabilities-key"/>
8991

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).
9193

9294
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.
9395

@@ -358,7 +360,7 @@ Note that a successful token request doesn't guarantee all requested capabilitie
358360

359361
#### Ably Token without capabilities <a id="ably-token-all"/>
360362

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.
362364

363365
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.
364366

@@ -435,7 +437,7 @@ if err != nil {
435437

436438
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.
437439

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.
439441

440442
<Code>
441443
```javascript
@@ -533,7 +535,7 @@ if err != nil {
533535

534536
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.
535537

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.
537539

538540
<Code>
539541
```javascript
@@ -595,15 +597,15 @@ if err != nil {
595597

596598
#### Ably JWT capability determination <a id="ably-jwt"/>
597599

598-
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:
599601

600602
* 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.
601603
* 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.
602604

603605
## Channel-scoped user claims <a id="custom-restrictions"/>
604606

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.
606608

607609
## Per-connection publish rate limits <a id="jwt-limits"/>
608610

609-
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.

src/pages/docs/auth/identified-clients.mdx renamed to src/pages/docs/platform/auth/identified-clients.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
title: Identified clients
33
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
46
---
57

68
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
3335
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.
3436

3537
<Aside data-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.
3739

3840
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.
3941
</Aside>
4042

4143
### Basic auth <a id="basic"/>
4244

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.
4446

4547
### Token auth <a id="token"/>
4648

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`.
4850

4951
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`.
5052

@@ -56,7 +58,7 @@ To set a `clientId` in a JWT, include the `x-ably-clientId` claim in the JWT pay
5658
| --- | --- |
5759
| `x-ably-clientId` | The `clientId` to assign to the client (for example, `user-123`). |
5860

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.
6062

6163
#### Using TokenRequest <a id="tokenrequest-clientid"/>
6264

@@ -129,8 +131,8 @@ final tokenRequest = rest.auth.createTokenRequest(
129131

130132
### Wildcard token auth <a id="wildcard"/>
131133

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.
133135

134136
## Unidentified clients <a id="unidentified"/>
135137

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

Comments
 (0)