All Projects → circa10a → Express Jwt

circa10a / Express Jwt

Licence: mit
An example API for creating/verifying json web tokens

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Express Jwt

Securing Restful Apis With Jwt
How to secure a Nodejs RESTful CRUD API using JSON web tokens?
Stars: ✭ 301 (+186.67%)
Mutual labels:  express, authentication, jwt, authorization
Express Mongodb Rest Api Boilerplate
A boilerplate for Node.js apps / Rest API / Authentication from scratch - express, mongodb (mongoose).
Stars: ✭ 153 (+45.71%)
Mutual labels:  express, authentication, jwt, authorization
Mern Boilerplate
Fullstack boilerplate with React, Redux, Express, Mongoose, Passport Local, JWT, Facebook and Google OAuth out of the box.
Stars: ✭ 112 (+6.67%)
Mutual labels:  express, authentication, jwt, authorization
Angular Full Stack
Angular Full Stack project built using Angular, Express, Mongoose and Node. Whole stack in TypeScript.
Stars: ✭ 1,261 (+1100.95%)
Mutual labels:  express, expressjs, jwt
Express Rest Api Boilerplate
Express REST API with JWT Authentication and support for sqlite, mysql, and postgresql
Stars: ✭ 384 (+265.71%)
Mutual labels:  express, authentication, jwt
Buji Pac4j
pac4j security library for Shiro: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 444 (+322.86%)
Mutual labels:  authentication, jwt, authorization
Auth0.js
Auth0 headless browser sdk
Stars: ✭ 755 (+619.05%)
Mutual labels:  authentication, jwt, authorization
Cerberus
A demonstration of a completely stateless and RESTful token-based authorization system using JSON Web Tokens (JWT) and Spring Security.
Stars: ✭ 482 (+359.05%)
Mutual labels:  authentication, jwt, authorization
Mean Angular5 Passport Authentication
Securing MEAN Stack (Angular 5) Web Application using Passport Authentication
Stars: ✭ 24 (-77.14%)
Mutual labels:  express, expressjs, authentication
Webauthn
W3C Web Authentication API Relying Party for Node.js and Express
Stars: ✭ 61 (-41.9%)
Mutual labels:  express, expressjs, authentication
Mern Stack Authentication
Secure MERN Stack CRUD Web Application using Passport.js Authentication
Stars: ✭ 60 (-42.86%)
Mutual labels:  express, expressjs, authentication
Grpc Auth Example
Examples of client authentication with gRPC
Stars: ✭ 65 (-38.1%)
Mutual labels:  authentication, jwt, authorization
Play Pac4j
Security library for Play framework 2 in Java and Scala: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 375 (+257.14%)
Mutual labels:  authentication, jwt, authorization
Grant
OAuth Proxy
Stars: ✭ 3,509 (+3241.9%)
Mutual labels:  express, authentication, authorization
Cloudfront Auth
An AWS CloudFront [email protected] function to authenticate requests using Google Apps, Microsoft, Auth0, OKTA, and GitHub login
Stars: ✭ 471 (+348.57%)
Mutual labels:  authentication, jwt, authorization
Nest Angular
NestJS, Angular 6, Server Side Rendering (Angular Universal), GraphQL, JWT (JSON Web Tokens) and Facebook/Twitter/Google Authentication, Mongoose, MongoDB, Webpack, TypeScript
Stars: ✭ 307 (+192.38%)
Mutual labels:  express, jwt, jwt-auth
Naperg
Fullstack Boilerplate GraphQL. Made with React & Prisma + authentication & roles
Stars: ✭ 661 (+529.52%)
Mutual labels:  expressjs, authentication, jwt
Authex
Authex is an opinionated JWT authentication and authorization library for Elixir.
Stars: ✭ 73 (-30.48%)
Mutual labels:  authentication, jwt, authorization
Auth Jwt
A demo to learn JWT by reverse engineering
Stars: ✭ 208 (+98.1%)
Mutual labels:  express, authentication, jwt
Express Graphql Mongodb Boilerplate
A boilerplate for Node.js apps / GraphQL-API / Authentication from scratch - express, graphql - (graphql compose), mongodb (mongoose).
Stars: ✭ 288 (+174.29%)
Mutual labels:  express, authentication, authorization

Express-JWT

An example API for creating/verifying json web tokens.

Yes, the private key is in the repo. Not secure. I know.

Usage

Install Dependencies

npm install

Start

npm start

Docker

docker run -d --name express-jwt -p 8000:8000 circa10a/express-jwt

Kubernetes

kubectl apply -f https://raw.githubusercontent.com/circa10a/express-jwt/master/k8s-deployment.yaml

Then navigate to http://localhost:8000/ to see the swagger api docs.

Configuration

Port

Default listens on port 8000, but can be changed by specifying a PORT environment variable.

Basic auth users

To obtain your JWT, you must authenticate against /login with Basic Auth.

There are 2 hardcoded sample users in config/config.js that can be used. You can also easily append to the object for more fake users.

Users

user password base64
admin admin YWRtaW46YWRtaW4=
guest password Z3Vlc3Q6cGFzc3dvcmQ=

JWT Expiration

In config/config.js the default expiration time of a JWT is 1h

Obtain token

curl -H "Authorization: Basic YWRtaW46YWRtaW4=" http://localhost:8000/login

Auth with token

You can use the token previously acquired via curl or here's a token with no expiration you can test with:

curl -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJpYXQiOjE1NjIzNDc0MzR9.g0-jxWgWVc98C6EzEWYoWxyIXVY3xmzgIZfD32PBZfrwrVrTiAqP69IrJ3DKBseeVgf2dwOm4ennwpakHXv-xxfZyMoM8-nfwJardv0Pr4bToBhGwxJhe-g1Hy7ygID5XpqQok9zY_R-0vZn-o-opi9VZYvTft9ZBAPEdj9oPZrRk_LfrrMQjO-oK9BiNQTjZm0rzFsqetk8FmqKwtb-TDPmmkgS0remsbsJzyvAi2x6r7fosljM2t0vjxdGzumbU4pxuSsQUjoRDzPG0VAH2rKNHECFqmCWJ8myIBOobYYAt7TIW0TzzJkyXb9amfDjy1IBlZyvwEznTUT_XBh6hQ" http://localhost:8000/protected
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].