awx-operator icon indicating copy to clipboard operation
awx-operator copied to clipboard

Import all ldap config classes in settings.py

Open mac-chaffee opened this issue 2 years ago • 3 comments

As discovered in #642 , if you are using AUTH_LDAP_GROUP_SEARCH, you also need to specify AUTH_LDAP_GROUP_TYPE (since different LDAP providers have different ways of representing groups). However, AUTH_LDAP_GROUP_TYPE needs to reference an object of type django_auth_ldap.config.LDAPGroupType, which means those classes must be imported at the top of the settings file (discovered in #925 ).

mac-chaffee avatar Jun 23 '22 12:06 mac-chaffee

Are there any known workarounds?

yarokifor avatar Jul 13 '22 20:07 yarokifor

It is possible to workaround this, but it's pretty gnarly:

extra_settings:
  - setting: AUTH_LDAP_SERVER_URI
    value: '"ldaps://example.com"; from django_auth_ldap.config import GroupOfNamesType'
  ...
  - setting: AUTH_LDAP_GROUP_TYPE
    value: "GroupOfNamesType(name_attr='cn')"

mac-chaffee avatar Jul 13 '22 20:07 mac-chaffee

Thank you ! I was stuck for ever on this issue and the work around work. This need to be merge asap as it is failing fresh install I think

guillaumelfv avatar Jul 14 '22 02:07 guillaumelfv

Apologies for the wait on this one. Thank you for the contribution!

rooftopcellist avatar Aug 24 '22 21:08 rooftopcellist