Skip to main content
Version: PromptQL

Frequently Asked Questions about Auth

Should I choose JWT or Webhook mode?

JWT mode is recommended for most use cases. It's easy to set up, integrates with many third-party providers and provides a robust security model.

Webhook mode is more flexible and can be useful for custom authentication scenarios. Webhook mode will be slightly slower than JWT mode due to the additional network request.

How do I test permissions with JWT mode?

You can test permissions directly in the Playground's interface:

  1. Define the desired permissions for a particular Type, Model, or Command in your metadata.
  2. Create a new build of your supergraph.
  3. Make a request through the PromptQL Playground with an auth token that includes the required session variables; you can do this by clicking the Auth button in the prompt input.
  4. Check the returned data to ensure it adheres to your permission configurations.

Read more about setting up a test token in the JWT mode tutorial.

How do I create a new role?

A role comes into existence when it is defined in one of TypePermissions, ModelPermissions, or CommandPermissions.

How do I delete a role?

To delete a role, you need to remove the role from all TypePermissions, ModelPermissions, and CommandPermissions objects.