Skip to content

Commit

Permalink
feat: optional oauth2 module nonce toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Jan 29, 2023
1 parent 12233c4 commit 5f876ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/modules/authentication/oauth2/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
callbackURL: conf.callbackURL,
passReqToCallback: true,
scope: conf.scope,
state: true
state: conf.enableCSRFProtection
}, async (req, accessToken, refreshToken, profile, cb) => {
try {
const user = await WIKI.models.users.processProfile({
Expand Down
6 changes: 6 additions & 0 deletions server/modules/authentication/oauth2/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,9 @@ props:
title: Pass access token via GET query string to User Info Endpoint
hint: (optional) Pass the access token in an `access_token` parameter attached to the GET query string of the User Info Endpoint URL. Otherwise the access token will be passed in the Authorization header.
order: 11
enableCSRFProtection:
type: Boolean
default: true
title: Enable CSRF protection
hint: Pass a nonce state parameter during authentication to protect against CSRF attacks.
order: 12

0 comments on commit 5f876ce

Please sign in to comment.