{"repo":"MaximeMRF/adonisjs-jwt","free":true,"listed":false,"github":"https://github.com/MaximeMRF/adonisjs-jwt","clone":"git clone https://github.com/MaximeMRF/adonisjs-jwt.git","description":"AdonisJS v7 and v6 package to authenticate users using JWT tokens","language":"TypeScript","stars":32,"topics":["adonis6","adonisjs","adonisjs6","auth","authentication","jwt-auth","jwt-authentication","jwt-token","jwt-tokens","adonis-framework"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"AdonisJS package to authenticate users using JWT tokens. Compatibility & Versions Package Version AdonisJS Version Node.js Required --------------- ----------------- ---------------- v0.7.x AdonisJS v6 = 20.6.0 v0.8.x AdonisJS v7 = 24.0.0 Prerequisites You have to install the auth package from AdonisJS Setup (AdonisJS v7) Install the package: Setup for AdonisJS v6 If you are using AdonisJS v6, you have to install the v0.7.x version of the package: Usage Go to config/auth.ts and add the following configuration: tokenName is the name of the jwt token passed as a cookie, it can be optional, by default it is token . tokenExpiresIn is the time before the jwt token expires it can be a string or a number and it can be optional. You can also use cookies for the authentication instead of the bearer token by setting useCookies to true . If you just want to use jwt with the bearer token no need to set useCookies to false you can just remove it. You can also pass options to the cookies. Note that maxAge and expires are omitted from the options because they are automatically handled by the package based on the token validity ( tokenExpiresIn and refreshTokenExpiresIn ). By default, httpOnly: true and secure: true are enforced for better security, but you can override them using the cookie object configuration. Asymmetric signing (RSA / ECDSA) You can sign access tokens with a private key and verify them with a public key only. Other services can validate JWTs using the public key without ","default_branch":null,"files":null,"tree":[],"storefront":"/r/MaximeMRF","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/MaximeMRF/adonisjs-jwt/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}