Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda