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

168
Visualizações
Make GraphQL api secure

I started using GQL with Express (It is awesome). So I have a couple questions.

  1. How can I make GQL secure so only I can access the API and playground in general. Like Instagram. You can't access their "playground".

  2. When I was working with rest api, I was sending tokens trough Headers to be secure. Where to put them now?

  app.use(
    "/graphql",
    graphqlHTTP({
      schema,
      graphiql: true,
    })
  )

Thank you.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

  1. I highly suggest that you don't keep your playground open into production. A playground is a web app with its own complexity and thus its own vulnerabilities. See Hacking GraphQL Playground
  2. Authentication is handled in GraphQL exactly the same as in REST. Actually you can even have a REST authentication over your GraphQL App. You can find a lot more information here about how to manage authentication, authorization, and access control properly in GraphQL here: Authentication, Authorization and Access Control for GraphQL
about 4 years ago · Juan Pablo Isaza Relatório

0

For 1) the playground is toggled on or off with that graphiql flag you have there. As for securing it you would want to use a middle where that checks an incoming token of some sort and allows/rejects based on the verification of that token.

  1. GraphQL works the exact same way as a REST endpoint in that respect. Tokens in the headers is the standard.
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