[EDU-2105] - Render both auth examples in examples page#2920
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
2fa8833 to
3c5aeb5
Compare
d53fd73 to
35db3af
Compare
35db3af to
e071f69
Compare
de1dab6 to
e3088cc
Compare
e3088cc to
52f39b1
Compare
52f39b1 to
3a04d13
Compare
3a04d13 to
5b6adab
Compare
8c5fdc3 to
2fd278a
Compare
a309b5d to
b10a0b2
Compare
m-hulbert
left a comment
There was a problem hiding this comment.
A few minor comments and we're there. Are we ably to raise the profile of the note about which method to prefer with an Aside or similar?
| Authentication is the first step for an application to communicate with Ably. The application initializes a client and calls a predefined `authUrl` endpoint on your backend server. This endpoint uses an API key to request a JWT from Ably and returns it to the requesting client. When the JWT nears expiry, the `authUrl` is automatically invoked to request a new JWT. | ||
| Authentication is the first step for an application to communicate with Ably. The application initializes a client with an `authCallback` that fetches credentials from your backend server. This endpoint uses an API key to generate a JWT and returns it to the requesting client. When the JWT nears expiry, the `authCallback` is automatically invoked to request a new JWT. | ||
|
|
||
| Authentication is implemented using [Ably Pub/Sub](https://ably.com/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. It provides a set of flexible APIs capable of building any realtime application and is powered by Ably's reliable and scalable platform. |
There was a problem hiding this comment.
| Authentication is implemented using [Ably Pub/Sub](https://ably.com/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. It provides a set of flexible APIs capable of building any realtime application and is powered by Ably's reliable and scalable platform. | |
| Authentication is implemented using [Ably Pub/Sub](https://ably.com/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. |
| Authentication is the first step for an application to communicate with Ably. The application initializes a client and calls a predefined `authUrl` endpoint on your backend server. This endpoint uses an API key to request a token from Ably and returns it to the requesting client. When the token nears expiry, the `authUrl` is automatically invoked to request a new token. | ||
| Authentication is the first step for an application to communicate with Ably. The application initializes a client with an `authCallback` that fetches credentials from your backend server. This endpoint uses an API key to request a token from Ably and returns it to the requesting client. When the token nears expiry, the `authCallback` is automatically invoked to request a new token. | ||
|
|
||
| Authentication is implemented using [Ably Pub/Sub](/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. It provides a set of flexible APIs capable of building any realtime application and is powered by Ably's reliable and scalable platform. |
There was a problem hiding this comment.
| Authentication is implemented using [Ably Pub/Sub](/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. It provides a set of flexible APIs capable of building any realtime application and is powered by Ably's reliable and scalable platform. | |
| Authentication is implemented using [Ably Pub/Sub](/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. |
|
|
||
| Authentication is implemented using [Ably Pub/Sub](/docs/auth). The Pub/Sub SDK provides the authentication mechanism that is utilized by all Ably products. It provides a set of flexible APIs capable of building any realtime application and is powered by Ably's reliable and scalable platform. | ||
|
|
||
| > **Note:** For most use cases, [JWTs](/docs/auth/token#jwt) are the recommended authentication method. They enable you to issue credentials without making a request to Ably, reducing latency and server dependencies. Ably Tokens are primarily useful when you need to use the Ably SDKs on the server-side to generate tokens with specific capabilities. |
There was a problem hiding this comment.
So the only time we're pointing people to use Ably Tokens are:
- Your capability list is too large and exceeds JWT size limits. JWTs must fit within HTTP header limits, typically around 8 KB.
- You need to keep your capability list confidential, as JWTs can be decoded by clients.
- You already have a JWT-based auth system and want to embed Ably tokens within your existing JWTs.
And I think we should be more firm with it - i.e. "Only use an Ably Token when:"
src/data/examples/index.ts
Outdated
| }, | ||
| { | ||
| id: 'auth-request-token', | ||
| name: 'Request Token', |
There was a problem hiding this comment.
| name: 'Request Token', | |
| name: 'Request an Ably Token', |
fd12610 to
9753514
Compare
3f69b18 to
8894554
Compare
8894554 to
5c335d0
Compare
- auth-generate-jwt: Switch JavaScript and React clients to authCallback - auth-request-token: Switch JavaScript and React clients to authCallback - Fix ES module compatibility (__dirname) in both servers - Change dotenv to load .env instead of .env.local - Fix JWT response format (send as text, not JSON)
5c335d0 to
a5bf8c3
Compare
Description
Checklist