Skip to content

Commit

Permalink
Replace keycloak-connect protect method with jsonwebtoken.verify
Browse files Browse the repository at this point in the history
We can use the verify() method that comes with the jsonwebtoken library
to verify the client's auth token is valid.
An invalid token will now return a Problem instance
Updated API spec
  • Loading branch information
TimCsaky committed Apr 16, 2024
1 parent 9ac36fc commit c8559dc
Show file tree
Hide file tree
Showing 8 changed files with 347 additions and 1,643 deletions.
4 changes: 0 additions & 4 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const helmet = require('helmet');
const moment = require('moment');

const { name: appName, version: appVersion } = require('./package.json');
const keycloak = require('./src/components/keycloak');
const log = require('./src/components/log')(module.filename);
const httpLogger = require('./src/components/log').httpLogger;
const { getGitRevision } = require('./src/components/utils');
Expand Down Expand Up @@ -69,9 +68,6 @@ if (process.env.NODE_ENV !== 'test') {
app.use(httpLogger);
}

// Use Keycloak OIDC Middleware
app.use(keycloak.middleware());

// Block requests until service is ready and mounted
app.use((_req, res, next) => {
if (state.shutdown) {
Expand Down

0 comments on commit c8559dc

Please sign in to comment.