Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda