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
d80bb928
Commit
d80bb928
authored
Apr 28, 2019
by
Nick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: okta auth module
parent
c03dae93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
10 deletions
+29
-10
authentication.js
server/modules/authentication/okta/authentication.js
+15
-8
definition.yml
server/modules/authentication/okta/definition.yml
+14
-2
No files found.
server/modules/authentication/okta/authentication.js
View file @
d80bb928
...
...
@@ -5,6 +5,7 @@
// ------------------------------------
const
OktaStrategy
=
require
(
'passport-okta-oauth'
).
Strategy
const
_
=
require
(
'lodash'
)
module
.
exports
=
{
init
(
passport
,
conf
)
{
...
...
@@ -15,14 +16,20 @@ module.exports = {
clientSecret
:
conf
.
clientSecret
,
idp
:
conf
.
idp
,
callbackURL
:
conf
.
callbackURL
,
response_type
:
'code'
,
scope
:
[
'openid'
,
'email'
,
'profile'
]
},
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
WIKI
.
models
.
users
.
processProfile
(
profile
).
then
((
user
)
=>
{
return
cb
(
null
,
user
)
||
true
}).
catch
((
err
)
=>
{
return
cb
(
err
,
null
)
||
true
})
response_type
:
'code'
},
async
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
try
{
const
user
=
await
WIKI
.
models
.
users
.
processProfile
({
profile
:
{
...
profile
,
picture
:
_
.
get
(
profile
,
'_json.profile'
,
''
)
},
providerKey
:
'okta'
})
cb
(
null
,
user
)
}
catch
(
err
)
{
cb
(
err
,
null
)
}
})
)
}
...
...
server/modules/authentication/okta/definition.yml
View file @
d80bb928
...
...
@@ -5,18 +5,30 @@ author: requarks.io
logo
:
https://static.requarks.io/logo/okta.svg
color
:
blue darken-1
website
:
https://www.okta.com/
isAvailable
:
true
useForm
:
false
scopes
:
-
profile
-
email
-
openid
props
:
clientId
:
title
:
Client ID
type
:
String
hint
:
20 chars alphanumeric string
order
:
2
clientSecret
:
title
:
Client Secret
type
:
String
hint
:
40 chars alphanumeric string with a hyphen(s)
order
:
3
idp
:
title
:
Identity Provider ID (idp)
type
:
String
hint
:
(optional) 20 chars alphanumeric string
hint
:
(Optional) - 20 chars alphanumeric string
order
:
4
audience
:
title
:
Org URL
type
:
String
hint
:
Okta domain (e.g. https://example.okta.com, https://example.oktapreview.com)
hint
:
Okta organization URL (e.g. https://example.okta.com, https://example.oktapreview.com), found on the Developer Dashboard, in the upper right.
order
:
1
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