Authentication

Authentication extensions are available in the Marketplace:

  • JWT: Validates a JWT token

You can learn how authentication extensions work and build your own with this follow along tutorial: Customize your GraphQL Federation authentication and authorization with Grafbase Extensions.

A complete example can be found on GitHub and the Grafbase SDK is the extension reference.

The Grafbase Gateway can act as an OAuth 2.1 protected resource server. A protected resource server has two responsibilities: enforcing access control (authentication and authorization), and exposing metadata (RFC 9728).

The open source extensions in the Extensions Marketplace, like the JWT extension, have out of the box support for this spec. Check out the relevant READMEs for configuration options.

If you want an extension only in order to expose protected resource metadata — for example if authentication is enforced at the subgraph level —, you can use the OAuth 2.0 Protected Resource Metadata extension.