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

Documentation on how to get the authenticated user #10589

Open
amitassaraf opened this issue Oct 27, 2024 · 2 comments
Open

Documentation on how to get the authenticated user #10589

amitassaraf opened this issue Oct 27, 2024 · 2 comments
Labels
c/docs Related to docs c/v3-engine V3 Metadata and Engine engine

Comments

@amitassaraf
Copy link

Hello, currently there seems to be no documentation on how to fetch the JWT token details of the user who has made the request to the typescript function. How can I do this?

@daniel-chambers
Copy link
Contributor

If you configure JWT authentication with your Supergraph, your claims can be made available as Session Variables. You can then bind session variables to command arguments using CommandPermissions (more docs here). Command arguments are just the arguments you define on your TypeScript function.

So in short:

  • Configure JWT auth on your supergraph to get claim values as session variables
  • Define arguments that would take your claim values on your functions
  • Introspect your connector then add commands for your functions
  • Use CommandPermissions to bind the session variables to your arguments

@daniel-chambers daniel-chambers transferred this issue from hasura/ndc-nodejs-lambda Nov 7, 2024
@daniel-chambers
Copy link
Contributor

daniel-chambers commented Nov 7, 2024

I've moved this issue to https://github.com/hasura/graphql-engine so where it can receive more attention. :) Our tooling is set up to monitor issues on this repo and this is where we collect them.

@manasag manasag added the c/docs Related to docs label Nov 8, 2024 — with Linear
@codedmart codedmart added engine c/v3-engine V3 Metadata and Engine labels Nov 20, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/docs Related to docs c/v3-engine V3 Metadata and Engine engine
Projects
None yet
Development

No branches or pull requests

4 participants