Allow SAML authentication provider to be named

Using `CMD_SAML_PROVIDERNAME` and the respective auth provider objects
in the configuration structures.

Signed-off-by: Moritz Schlarb <schlarbm@uni-mainz.de>
This commit is contained in:
Moritz Schlarb 2022-03-11 14:32:40 +01:00 committed by David Mehren
parent 002c7897d8
commit e6fc9f01a3
6 changed files with 6 additions and 1 deletions

1
app.js
View file

@ -212,6 +212,7 @@ app.locals.authProviders = {
ldap: config.isLDAPEnable, ldap: config.isLDAPEnable,
ldapProviderName: config.ldap.providerName, ldapProviderName: config.ldap.providerName,
saml: config.isSAMLEnable, saml: config.isSAMLEnable,
samlProviderName: config.saml.providerName,
oauth2: config.isOAuth2Enable, oauth2: config.isOAuth2Enable,
oauth2ProviderName: config.oauth2.providerName, oauth2ProviderName: config.oauth2.providerName,
openID: config.isOpenIDEnable, openID: config.isOpenIDEnable,

View file

@ -228,6 +228,7 @@ these are rarely used for various reasons.
| | `CMD_SAML_ATTRIBUTE_ID` | **no default**, `sAMAccountName` | attribute map for `id` (optional, default: NameID of SAML response) | | | `CMD_SAML_ATTRIBUTE_ID` | **no default**, `sAMAccountName` | attribute map for `id` (optional, default: NameID of SAML response) |
| | `CMD_SAML_ATTRIBUTE_USERNAME` | **no default**, `mailNickname` | attribute map for `username` (optional, default: NameID of SAML response) | | | `CMD_SAML_ATTRIBUTE_USERNAME` | **no default**, `mailNickname` | attribute map for `username` (optional, default: NameID of SAML response) |
| | `CMD_SAML_ATTRIBUTE_EMAIL` | **no default**, `mail` | attribute map for `email` (optional, default: NameID of SAML response if `CMD_SAML_IDENTIFIERFORMAT` is default) | | | `CMD_SAML_ATTRIBUTE_EMAIL` | **no default**, `mail` | attribute map for `email` (optional, default: NameID of SAML response if `CMD_SAML_IDENTIFIERFORMAT` is default) |
| | `CMD_SAML_PROVIDERNAME` | **no default**, `My institution` | Optional name to be displayed at login form indicating the SAML provider |
### Twitter Login ### Twitter Login

View file

@ -144,6 +144,7 @@ module.exports = {
tlsca: undefined tlsca: undefined
}, },
saml: { saml: {
providerName: undefined,
idpSsoUrl: undefined, idpSsoUrl: undefined,
idpCert: undefined, idpCert: undefined,
clientCert: undefined, clientCert: undefined,

View file

@ -134,6 +134,7 @@ module.exports = {
tlsca: process.env.CMD_LDAP_TLS_CA tlsca: process.env.CMD_LDAP_TLS_CA
}, },
saml: { saml: {
providerName: process.env.CMD_SAML_PROVIDERNAME,
idpSsoUrl: process.env.CMD_SAML_IDPSSOURL, idpSsoUrl: process.env.CMD_SAML_IDPSSOURL,
idpCert: process.env.CMD_SAML_IDPCERT, idpCert: process.env.CMD_SAML_IDPCERT,
clientCert: process.env.CMD_SAML_CLIENTCERT, clientCert: process.env.CMD_SAML_CLIENTCERT,

View file

@ -8,6 +8,7 @@
### Enhancements ### Enhancements
- Libravatar avatars render as ident-icons when no avatar image was uploaded to Libravatar or Gravatar - Libravatar avatars render as ident-icons when no avatar image was uploaded to Libravatar or Gravatar
- Add database connection error message to log output - Add database connection error message to log output
- Allow SAML authentication provider to be named
## <i class="fa fa-tag"></i> 1.9.2 <i class="fa fa-calendar-o"></i> 2021-12-03 ## <i class="fa fa-tag"></i> 1.9.2 <i class="fa fa-calendar-o"></i> 2021-12-03

View file

@ -45,7 +45,7 @@
<% } %> <% } %>
<% if (authProviders.saml) { %> <% if (authProviders.saml) { %>
<a href="<%- serverURL %>/auth/saml" class="btn btn-lg btn-block btn-social btn-success"> <a href="<%- serverURL %>/auth/saml" class="btn btn-lg btn-block btn-social btn-success">
<i class="fa fa-users"></i> <%= __('Sign in via %s', 'SAML') %> <i class="fa fa-users"></i> <%= __('Sign in via %s', authProviders.samlProviderName || 'SAML') %>
</a> </a>
<% } %> <% } %>
<% if (authProviders.oauth2) { %> <% if (authProviders.oauth2) { %>