Skip to content

Instantly share code, notes, and snippets.

@ThiefMaster
Last active October 25, 2017 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThiefMaster/565211a992cca464fe0409775af69846 to your computer and use it in GitHub Desktop.
Save ThiefMaster/565211a992cca464fe0409775af69846 to your computer and use it in GitHub Desktop.
_ldap_config = {
'uri': 'ldaps://...',
'bind_dn': 'cn=***,OU=Users,OU=Organic Units,DC=cern,DC=ch',
'bind_password': '***',
'timeout': 30,
'verify_cert': True,
'page_size': 1500,
'uid': 'cn',
'user_base': 'DC=cern,DC=ch',
'user_filter': '(objectCategory=user)',
'gid': 'cn',
'group_base': 'OU=Workgroups, DC=cern, DC=ch',
'group_filter': '(objectCategory=group)',
'member_of_attr': 'memberOf',
'ad_group_style': True,
}
AUTH_PROVIDERS = {
'ldap': {
'type': 'ldap',
'title': 'LDAP',
'ldap': _ldap_config,
'default': True
}
}
IDENTITY_PROVIDERS = {
'ldap': {
'type': 'ldap',
'title': 'LDAP',
'ldap': _ldap_config,
'mapping': {
'first_name': 'givenName',
'last_name': 'sn',
'email': 'mail',
'affiliation': 'company',
'phone': 'telephoneNumber',
},
'trusted_email': True,
'default_group_provider': True,
'synced_fields': {'first_name', 'last_name', 'affiliation', 'phone', 'address'}
}
}
PROVIDER_MAP = {
'ldap': 'ldap'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment