Browse Source

feat(auth): OAuth2 scope support (#5181)

pull/5192/head
myml 2 years ago
committed by GitHub
parent
commit
74887baa86
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions
  1. 3
      server/modules/authentication/oauth2/authentication.js
  2. 5
      server/modules/authentication/oauth2/definition.yml

3
server/modules/authentication/oauth2/authentication.js

@ -17,7 +17,8 @@ module.exports = {
clientSecret: conf.clientSecret,
userInfoURL: conf.userInfoURL,
callbackURL: conf.callbackURL,
passReqToCallback: true
passReqToCallback: true,
scope: conf.scope
}, async (req, accessToken, refreshToken, profile, cb) => {
try {
const user = await WIKI.models.users.processProfile({

5
server/modules/authentication/oauth2/definition.yml

@ -59,3 +59,8 @@ props:
title: Logout URL
hint: (optional) Logout URL on the OAuth2 provider where the user will be redirected to complete the logout process.
order: 9
scope:
type: String
title: Scope
hint: (optional) Application Client permission scopes.
order: 10
Loading…
Cancel
Save