This library will help you work with JWTs.

Installing it

You have several options:


jwtHelper will take care of helping you decode the token and check its expiration date.

Decoding the token

Getting the token expiration date

Checking if token is expired

More examples

You can see some more examples of how this works in the tests


JWT interceptor will take care of sending the JWT in every request.

Basic usage

Not sending the JWT for specific requests

Sending different tokens based on URLs

Using promises on the tokenGetter: Refresh Token example

As sometimes we need to get first the id_token in order to send it, we can return a promise in the tokenGetter. Let's see for example how we'd use a refresh_token

More examples

You can see some more examples of how this works in the tests


This library is used in auth0-angular


Just clone the repo, run npm install, bower install and then gulp to work :).

What is Auth0?

Auth0 helps you to:

  • Add authentication with multiple authentication sources, either social like Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, amont others, or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider.
  • Add authentication through more traditional username/password databases.
  • Add support for linking different user accounts with the same user.
  • Support for generating signed Json Web Tokens to call your APIs and flow the user identity securely.
  • Analytics of how, when and where users are logging in.
  • Pull data from other sources and add it to the user profile, through JavaScript rules.

Create a free account in Auth0

  1. Go to Auth0 and click Sign Up.
  2. Use Google, GitHub or Microsoft Account to login.



comments powered by Disqus
This page was last updated about 4 years ago.