2.0.0 • Published 1 year ago
@natlibfi/passport-melinda-jwt v2.0.0
Passport authentication strategy for Melinda using jwt tokens
Melinda implementation of passport + jwt token authorization
How to implement in server side
Create JWT token
import {generateJwtToken} from '@natlibfi/passport-melinda-jwt';
const token: generateJwtToken(payload, {
secretOrPrivateKey,
issuer,
audience,
algorithm
});- secretOrPrivateKey: secret
- issuer: String value of issuer
- audience: String value of audience
- algorithm: encryption method default: 'HS512'
Check JWT token
import MelindaJwtStrategy, {verify, jwtFromRequest} from '@natlibfi/passport-melinda-jwt';
passport.use(new MelindaJwtStrategy({
secretOrKey
issuer,
audience,
algorithms,
jwtFromRequest
}, verify));- secretOrKey: secret
- issuer: String value of issuer
- audience: String value of audience
- algorithms: String array, e.g. 'HS512'
- jwtFromRequest: Function that gets token from request (Default contained in this repository)
- verify: Function to verify token content (Default contained in this repository)
How to implement in client side
headers: {
Authorization: token,
}- Send token as authorization header in requests
License and copyright
Copyright (c) 2021-2024 University Of Helsinki (The National Library Of Finland)
This project's source code is licensed under the terms of MIT or any later version.
2.0.0-alpha.6
1 year ago
2.0.0
1 year ago
1.0.8-alpha.1
2 years ago
2.0.0-alpha.4
2 years ago
2.0.0-alpha.5
2 years ago
1.0.7
2 years ago
1.0.7-alpha.1
2 years ago
1.0.6-alpha.1
2 years ago
1.0.6
2 years ago
2.0.0-alpha.2
2 years ago
2.0.0-alpha.1
2 years ago
1.0.5-alpha.1
2 years ago
1.0.5
2 years ago
1.0.4-alpha.1
2 years ago
1.0.4
2 years ago
1.0.3-alpha.1
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.2-alpha.1
3 years ago
1.0.1
5 years ago
1.0.0
5 years ago