Using dashboard for querying
Dashboard works great for this too, we give you a functions tab for running any function, and let you specify the auth token fields!
8 Replies
Hey @ballingt just wanted to try out the dashboard to run authenticated queries from it but then got stuck on the act as a user parameters. what excactly should I put in these? I went to the docs https://docs.convex.dev/dashboard/deployments/functions#assuming-a-user-identity and they only specify that it should be a
string
. Could you elaborate on that?
Additionally this may be an opportunity to improve the docs.Functions | Convex Developer Hub
Functions Dashboard View
what excactly should I put in these?It depends on which ones you use from
const identity = await ctx.auth.getUserIdentity();
It's hard to anticipate since it's your own code that reads these, but most auth logic uses subject
Im using Clerk
This is about what your code does in your convex functions, what properties of the identity do you use?
getUserIdentity().tokenIdentifier
cool so you want to find the right
tokenIdentifier
for the user you want to impersonate. If you're not trying to impersonate any user in particular then you can make up a string.
tokenIdentifier is a combination of subject and issuer to ensure uniqueness even when multiple providers are used.
so the tokenIdentifier is the subject?
.subject
is the subject, Token identifier is a combination of the subject and the issuer