Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
Assign multiple user to HASURA_GRAPHQL_UNAUTHORIZED_ROLE

enter image description here

This is hasura console environment variable screenshot,

Is it possible to assign multiple user role in hasura console? right now its not working for me,

only public_user is working, its avoiding everything after space. when I do query with admin_user role, I am getting error like tablename not found in query_root.

Also If I move admin_user before public_user, then public_user will stop working.

Or is there any other way we can have 2 unauthorized role in hasura.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

From the docs:

You can use the env variable HASURA_GRAPHQL_UNAUTHORIZED_ROLE or the --unauthorized-role flag to set a role for unauthenticated (non-logged in) users.

Only one role allowed.

If you want to make requests as admin user you need to pass the value of HASURA_GRAPHQL_ADMIN_SECRET as a header.

await fetch(`https://url.com/v1/graphql`, {
  method: "POST",
  body: JSON.strigify({}),
  headers: { "x-hasura-admin-secret": process.env.HASURA_GRAPHQL_ADMIN_SECRET },
});

This is the simplest mode of authentication. Here's how authentication with an admin secret works:

  1. Hasura is configured with an admin password on startup
  2. When making an API request the client passes the admin password in the header X-Hasura-Admin-Secret
  3. Hasura validates the admin secret and allows access to all resources
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!