Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
fix(pkg): install express-jwt from @labshare/express-jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
kv979w committed Apr 6, 2021
1 parent 08662a9 commit 37462b6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
37 changes: 19 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
},
"homepage": "https://github.com/LabShare/services-auth#readme",
"dependencies": {
"@labshare/express-jwt": "^6.1.0",
"@loopback/boot": "^1.4.4",
"@loopback/context": "^1.20.2",
"@loopback/core": "^1.8.5",
"@loopback/rest": "^1.16.3",
"express-jwt": "github:KalleV/express-jwt#dad0daebe354a9ad0fc8ab160e406fd5a3cac7d9",
"jwks-rsa": "^1.12.2",
"parse-bearer-token": "^1.0.1",
"tiny-json-http": "^7.1.2"
Expand Down
5 changes: 4 additions & 1 deletion src/providers/authentication.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@loopback/rest';
import {AuthenticateFn, AuthenticationBindings} from '../keys';
import * as jwksClient from 'jwks-rsa';
import * as jwt from 'express-jwt';
import * as jwt from '@labshare/express-jwt';
import getToken from 'parse-bearer-token';
import {CoreBindings} from '@loopback/core';
import {get} from 'lodash';
Expand All @@ -23,6 +23,8 @@ const defaultJwksClientOptions = {
jwksRequestsPerMinute: 10,
};

const defaultAlgorithms = ['HS256', 'RS256'];

interface ParsedParams {
path: {[key: string]: any};
query: {[key: string]: any};
Expand Down Expand Up @@ -146,6 +148,7 @@ export class AuthenticateActionProvider implements Provider<AuthenticateFn> {
audience: jwtAudience, // Optionally validate the audience and the issuer
issuer,
credentialsRequired,
algorithms: defaultAlgorithms,
})(request, response, (error: any) => {
if (error) {
reject(error);
Expand Down

0 comments on commit 37462b6

Please sign in to comment.