mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 11:15:23 -04:00
add error handling to saml-certs
Signed-off-by: Simeon Keske <git@n0emis.eu> Signed-off-by: Leo Maroni <git@em0lar.de>
This commit is contained in:
parent
35ec617007
commit
bab0409ed0
1 changed files with 15 additions and 2 deletions
|
@ -16,8 +16,21 @@ passport.use(new SamlStrategy({
|
||||||
callbackUrl: config.serverURL + '/auth/saml/callback',
|
callbackUrl: config.serverURL + '/auth/saml/callback',
|
||||||
entryPoint: config.saml.idpSsoUrl,
|
entryPoint: config.saml.idpSsoUrl,
|
||||||
issuer: config.saml.issuer || config.serverURL,
|
issuer: config.saml.issuer || config.serverURL,
|
||||||
cert: fs.readFileSync(config.saml.idpCert, 'utf-8'),
|
privateCert: config.saml.clientCert === undefined ? undefined : (function () {
|
||||||
privateCert: config.saml.clientCert === undefined ? undefined : fs.readFileSync(config.saml.clientCert, 'utf-8'),
|
try {
|
||||||
|
return fs.readFileSync(config.saml.clientCert, 'utf-8')
|
||||||
|
} catch (e) {
|
||||||
|
logger.error('saml client certificate not found at: ' + config.saml.clientCert)
|
||||||
|
}
|
||||||
|
}()),
|
||||||
|
cert: (function () {
|
||||||
|
try {
|
||||||
|
return fs.readFileSync(config.saml.idpCert, 'utf-8')
|
||||||
|
} catch (e) {
|
||||||
|
logger.error('saml idp certificate not found at: ' + config.saml.idpCert)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
}()),
|
||||||
identifierFormat: config.saml.identifierFormat,
|
identifierFormat: config.saml.identifierFormat,
|
||||||
disableRequestedAuthnContext: config.saml.disableRequestedAuthnContext
|
disableRequestedAuthnContext: config.saml.disableRequestedAuthnContext
|
||||||
}, function (user, done) {
|
}, function (user, done) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue