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

274
Visualizações
JWT tokens refresh and access best practice for browsers and mobile apps

I am trying to create an auth server with nodejs and mongodb. I am trying to implement JWT auth with access and refresh tokens. I have read that you should store the access token in localstorage or memory and then pass the refresh token with an httponly cookie to protect against XSS attacks. The problem with the http only cookie is that you cant use this with things like mobile apps. The whole point of creating a rest api is so you can access the data from anywhere.

So what is the best way to handle different storage requirements of different devices and keeping them secure. Is there a good solution for either storing the refresh token on the browser without a httponly cookie? Should I just use localStorage even though its vulnerable to XSS attacks? Or do I need to create different endpoints for mobile and browser. Is there an industry standard for this? There is a lot of talk about using JWT but there does not seam to be a clear explanation of how to securely implement access and refresh tokens for mobile and browser apps alike.

about 4 years ago · Juan Pablo Isaza
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