feat: authentication improvements

This commit is contained in:
NGPixel
2018-08-04 17:27:55 -04:00
committed by Nicolas Giard
parent 2817c72ec3
commit bcd6ceb271
39 changed files with 1727 additions and 1828 deletions

View File

@@ -0,0 +1,29 @@
/* global WIKI */
// ------------------------------------
// Okta Account
// ------------------------------------
const OktaStrategy = require('passport-okta-oauth').Strategy
module.exports = {
init (passport, conf) {
passport.use('okta',
new OktaStrategy({
audience: conf.audience,
clientID: conf.clientId,
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
})
})
)
}
}

View File

@@ -0,0 +1,21 @@
key: okta
title: Okta
description: Okta provide secure identity management and single sign-on to any application.
author: requarks.io
logo: https://static.requarks.io/logo/okta.svg
website: https://www.okta.com/
useForm: false
props:
clientId:
type: String
hint: 20 chars alphanumeric string
clientSecret:
type: String
hint: 40 chars alphanumeric string with a hyphen(s)
idp:
title: Identity Provider ID (idp)
type: String
hint: (optional) 20 chars alphanumeric string
audience:
type: String
hint: Okta domain (e.g. https://example.okta.com, https://example.oktapreview.com)