Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign user role based on LDAP group #74

Open
giesselmann opened this issue Nov 30, 2022 · 3 comments
Open

Assign user role based on LDAP group #74

giesselmann opened this issue Nov 30, 2022 · 3 comments

Comments

@giesselmann
Copy link
Collaborator

Hi,
I wanted to suggest another feature which might become handy having cc in a larger organization:
Is it possible or could we implement a way, to derive a cc user-role from LDAP groups?

For example default to 'user' for all, but have employees automatically as 'support' role members.

Cheers,
Pay

@moebiusband73
Copy link
Member

Could you make a suggestion how this is specified in ldap. Would it be sufficient to add a fields that contains the information together with a map which group maps to which role?

@giesselmann
Copy link
Collaborator Author

I have to read up on LDAP a bit, I have no idea how this looks under the hood.
So far just a could be nice to have enhancement issue.

@moebiusband73
Copy link
Member

moebiusband73 commented Jun 22, 2023

You may want to have a look at the ldap sync routine

func (la *LdapAuthenticator) Sync() error {

The problem is that ldap directories might use different attributes. E.g. we use the gecos attribute for the Real name of the user. Not sure if this is filled in all the time.
In general you have to know which attribute of the user entry you want to map, and then provide a map in the ldap configuration to specify which value you want to map to which role. Unmapped entries fall back to user role.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants