Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token authentication documentation clarity #2120

Open
mclark-ably opened this issue Feb 1, 2024 · 1 comment
Open

Token authentication documentation clarity #2120

mclark-ably opened this issue Feb 1, 2024 · 1 comment

Comments

@mclark-ably
Copy link

mclark-ably commented Feb 1, 2024

On https://ably.com/docs/api/rest-api#token-authentication we talk about an Ably-compatible token which covers an Ably token or an Ably JWT

Token Authentication uses an Ably-compatible token to authenticate with Ably without sharing a private API key. This can be an Ably Token obtained via the REST API requestToken endpoint, an Ably JWT signed by your API key, or an External JWT object with an embedded Ably-compatible token.

but then on https://ably.com/docs/auth/token?lang=javascript#embedded

If a system has an existing JWT scheme, it’s possible to embed an Ably Token as a claim within it.
Where maybe it should also say an Ably-compatible token instead of Ably Token

Its not really clear that instead of embedding an Ably token (requiring a request to Ably) you can also embed an Ably JWT that is signed by the auth server

┆Issue is synchronized with this Jira Task by Unito

@mschristensen
Copy link
Contributor

mschristensen commented Feb 1, 2024

Just to add some more context on this:

  1. We document how to construct your own JWT using your API key: https://ably.com/docs/auth/token?lang=javascript#standard
  2. And we document how to embed and Ably Token in your own JWT under x-ably-token: https://ably.com/docs/auth/token?lang=javascript#embedded

But from the diagram in (2), it makes it look like the Ably Token must be retrieved from Ably servers. However this is not the only option, any valid token that can be used to authenticate with Ably can be included in x-ably-token, including one that you can construct yourself as documented in (1).

cc @paddybyers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants