Files
graylog2-server/graylog2-web-interface/test/fixtures/authenticationBackends.ts
Patrick Mann 788d4aa5b5 Add email attribute to LDAP config (#14041)
* add email attribute to LDAP config

* changelog

* fix unit test

* fix typo in string const

* fix more failing tests

* add email_attributes to Create and edit form

* fix typescript

* update help text

* show emailAttributes

* exclude emailAttributes for AD

* revert Select.tsx

* Update graylog2-web-interface/src/components/authentication/directoryServices/BackendWizard/UserSyncStep.tsx

Co-authored-by: Dan Torrey <dan@graylog.com>

* map email attribute to value

Co-authored-by: Ousmane Samba <ousmane@graylog.com>
Co-authored-by: Dan Torrey <dan@graylog.com>
2022-12-29 15:44:41 +01:00

62 lines
2.2 KiB
TypeScript

/*
* Copyright (C) 2020 Graylog, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Server Side Public License for more details.
*
* You should have received a copy of the Server Side Public License
* along with this program. If not, see
* <http://www.mongodb.com/licensing/server-side-public-license>.
*/
import * as Immutable from 'immutable';
import AuthenticationBackend from 'logic/authentication/AuthenticationBackend';
export const ldapBackend = AuthenticationBackend.builder()
.id('ldap-auth-backend-id')
.title('Ldap authentication backend')
.description('Ldap authentication backend')
.defaultRoles(Immutable.List(['reader-role-id']))
.config({
servers: [{ host: 'localhost', port: 389 }],
systemUserDn: '',
systemUserPassword: { isSet: false },
transportSecurity: 'none',
type: 'ldap',
emailAttributes: ['email', 'rfc822Mailbox'],
userFullNameAttribute: 'cn',
userNameAttribute: 'uid',
userSearchBase: 'cn=users,dc=example,dc=com',
userSearchPattern: '(&(objectClass=person)(sn={0}))',
userUniqueIdAttribute: 'entryUUID',
verifyCertificates: true,
})
.build();
export const activeDirectoryBackend = AuthenticationBackend.builder()
.id('ldap-auth-backend-id')
.title('Active directory authentication backend')
.description('Active directory authentication backend')
.defaultRoles(Immutable.List(['reader-role-id']))
.config({
servers: [{ host: 'localhost', port: 636 }],
systemUserDn: '',
systemUserPassword: { isSet: false },
transportSecurity: 'tls',
type: 'active-directory',
emailAttributes: ['email', 'rfc822Mailbox'],
userFullNameAttribute: 'displayName',
userNameAttribute: 'userPrincipalName',
userSearchBase: 'cn=users,dc=example,dc=com',
userSearchPattern: '(&(objectClass=user)(|(sAMAccountName={0})(userPrincipalName={0})))',
userUniqueIdAttribute: undefined,
verifyCertificates: true,
})
.build();