Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
91221e73
Unverified
Commit
91221e73
authored
Sep 06, 2022
by
Fionera
Committed by
GitHub
Sep 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: set groups based on OIDC claim (#5568)
Co-authored-by:
Nicolas Giard
<
github@ngpixel.com
>
parent
31bd3274
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
authentication.js
server/modules/authentication/oidc/authentication.js
+11
-0
definition.yml
server/modules/authentication/oidc/definition.yml
+14
-1
No files found.
server/modules/authentication/oidc/authentication.js
View file @
91221e73
...
@@ -29,6 +29,17 @@ module.exports = {
...
@@ -29,6 +29,17 @@ module.exports = {
email
:
_
.
get
(
profile
,
'_json.'
+
conf
.
emailClaim
)
email
:
_
.
get
(
profile
,
'_json.'
+
conf
.
emailClaim
)
}
}
})
})
if
(
conf
.
mapGroups
)
{
const
groups
=
_
.
get
(
profile
,
'_json.'
+
conf
.
groupsClaim
)
if
(
groups
)
{
const
groupIDs
=
Object
.
values
(
WIKI
.
auth
.
groups
)
.
filter
(
g
=>
groups
.
includes
(
g
.
name
))
.
map
(
g
=>
g
.
id
)
for
(
let
groupID
of
groupIDs
)
{
await
user
.
$relatedQuery
(
'groups'
).
relate
(
groupID
)
}
}
}
cb
(
null
,
user
)
cb
(
null
,
user
)
}
catch
(
err
)
{
}
catch
(
err
)
{
cb
(
err
,
null
)
cb
(
err
,
null
)
...
...
server/modules/authentication/oidc/definition.yml
View file @
91221e73
...
@@ -49,8 +49,21 @@ props:
...
@@ -49,8 +49,21 @@ props:
default
:
email
default
:
email
maxWidth
:
500
maxWidth
:
500
order
:
7
order
:
7
mapGroups
:
type
:
Boolean
title
:
Map Groups
hint
:
Map groups matching names from the groups claim value
default
:
false
order
:
8
groupsClaim
:
type
:
String
title
:
Groups Claim
hint
:
Field containing the group names
default
:
groups
maxWidth
:
500
order
:
9
logoutURL
:
logoutURL
:
type
:
String
type
:
String
title
:
Logout URL
title
:
Logout URL
hint
:
(optional) Logout URL on the OAuth2 provider where the user will be redirected to complete the logout process.
hint
:
(optional) Logout URL on the OAuth2 provider where the user will be redirected to complete the logout process.
order
:
8
order
:
10
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment