This library provides an HttpInterceptor which automatically attaches a JSON Web Token to HttpClient requests. This library does not have any functionality for (or opinion about) implementing user authentication and retrieving JWTs to begin with. Those details will vary depending on your setup, but in most cases, you will use a regular HTTP request to authenticate your users and then save their JWTs in local storage or in a cookie if successful. This library can only be used with Angular 4.3 and higher because it relies on an HttpInterceptor from Angular's HttpClient. This feature is not available on lower versions. If you are only interested in the JWT Decoder and are not interested in extended injectable features, you can simply create an instance of the utility and use it directly. Any requests sent using Angular's HttpClient will automatically have a token attached as an Authorization header.

Features

  • This library relies on the URL interface which is not supported in IE11
  • To solve the IE11 compatibility, you can add a polyfill
  • Standalone version
  • Import the JwtModule module and add it to your imports list
  • Any requests sent using Angular's HttpClient will automatically have a token attached as an Authorization header
  • The tokenGetter is a function which returns the user's token

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow angular-jwt

angular-jwt Web Site

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of angular-jwt!

Additional Project Details

Operating Systems

Mac, Windows

Programming Language

TypeScript

Related Categories

TypeScript Libraries

Registered

2022-03-07