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

481
Vistas
Using AWS Cognito Vuejs

I have built a backend API in Expressjs app, I am hosting it on AWS EC2. I have built a frontend application in Vuejs to communicate with the Express API.

I need to create Authorization for users to sign-in, and have decided AWS Cognito for user management.

Looking through the docs, do not really give much on how to authenticate from a front-end application to the backendAPI.

I know I can authenticate the Vuejs but that still leaves my routes open to be called directly.

So my question is how do I sign in from a frontend application like VueJS and verify the Auth token in the backend API endpoints.

Looking for any logic or possible docs on how to accomplish this, or if I am not looking at this correctly if someone can gives some tips.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

First, you'll authenticate your users with Cognito:

  • either using their hosted UI ( https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-integration.html )
  • or with Amplify ( https://aws-amplify.github.io/docs/js/authentication )
  • or with the AWS SDK if you want to downgrade ( https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_InitiateAuth.html )

At that point, you'll have a set of JWT tokens (ID token, access token, and depending on the authentication flow you choose, refresh token).

Now you can pass the access token/id to your backend API and verify it:

  • using the API Gateway Lambda authorizer, if applicable ( https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html )
  • verifying the token and claims manually ( https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-verifying-a-jwt.html ). You can find implementations of this on Github.
    If you're using Node, one of the options is cognito-jwt-verifier : a small npm package to verify id and access JWT tokens obtained from AWS Cognito in your node/Lambda backend with minimal dependencies (disclaimer: I'm the package author).
over 4 years ago · Santiago Trujillo 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