From 9c5a3d3c94b5907636d2af41a621892037e12eee Mon Sep 17 00:00:00 2001 From: rob Date: Tue, 5 Jul 2022 16:03:30 -0400 Subject: [PATCH] OAuth updates --- app/services/oauth2.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/services/oauth2.js b/app/services/oauth2.js index ba06419..d067858 100644 --- a/app/services/oauth2.js +++ b/app/services/oauth2.js @@ -59,15 +59,15 @@ class OAuth2Service extends SiteService { const verifyHttpBearer = this.verifyHttpBearer.bind(this); const basicStrategy = new BasicStrategy(verifyClient); - this.log.info('registering Basic strategy', { basicStrategy }); + this.log.info('registering Basic strategy', { name: basicStrategy.name }); passport.use(basicStrategy); const clientPasswordStrategy = new ClientPasswordStrategy(verifyClient); - this.log.info('registering ClientPassword strategy', { clientPasswordStrategy }); + this.log.info('registering ClientPassword strategy', { name: clientPasswordStrategy.name }); passport.use(clientPasswordStrategy); const httpBearerStrategy = new BearerStrategy(verifyHttpBearer); - this.log.info('registering Bearer strategy', { httpBearerStrategy }); + this.log.info('registering Bearer strategy', { name: httpBearerStrategy.name }); passport.use(httpBearerStrategy); } @@ -274,13 +274,13 @@ class OAuth2Service extends SiteService { return client; } - async verifyClient(clientId, clientSecret, done) { + async verifyClient (clientId, clientSecret, done) { const client = await this.getClientById(clientId); if (!client) { this.log.alert('OAuth2 request from unknown client', { clientId }); return done(null, false); } - if (client.clientSecret !== clientSecret) { + if (client.secret !== clientSecret) { this.log.alert('OAuth2 client secret mismatch', { clientId }); return done(null, false); }