Skip to content

SEC-1877: Allow injection of rolePrefix to LdapUserDetailsManager #2083

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

Closed
spring-projects-issues opened this issue Dec 21, 2011 · 3 comments · Fixed by #14574
Closed

SEC-1877: Allow injection of rolePrefix to LdapUserDetailsManager #2083

spring-projects-issues opened this issue Dec 21, 2011 · 3 comments · Fixed by #14574
Assignees
Labels
in: ldap An issue in spring-security-ldap status: duplicate A duplicate of another issue type: enhancement A general enhancement type: jira An issue that was migrated from JIRA
Milestone

Comments

@spring-projects-issues
Copy link

Yale Madden (Migrated from SEC-1877) said:

The rolePrefix member of LdapUserDetailsManager defaults to "ROLE_." This forces me to use this default rolePrefix throughout my application. Otherwise, convertAuthorityToGroup does not remove my rolePrefix and calls to createUser and updateUser return the following error:

javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=myprefix_user,ou=groups'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_modifyAttributes(Unknown Source)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_modifyAttributes(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(Unknown Source)
at javax.naming.directory.InitialDirContext.modifyAttributes(Unknown Source)
at org.springframework.security.ldap.userdetails.LdapUserDetailsManager$5.executeWithContext(LdapUserDetailsManager.java:331)
at org.springframework.ldap.core.LdapTemplate.executeWithContext(LdapTemplate.java:807)
at org.springframework.ldap.core.LdapTemplate.executeReadWrite(LdapTemplate.java:802)
at org.springframework.security.ldap.userdetails.LdapUserDetailsManager.modifyAuthorities(LdapUserDetailsManager.java:323)
at org.springframework.security.ldap.userdetails.LdapUserDetailsManager.addAuthorities(LdapUserDetailsManager.java:315)
at org.springframework.security.ldap.userdetails.LdapUserDetailsManager.updateUser(LdapUserDetailsManager.java:274)

Please provide a public setter for the rolePrefix member.

@spring-projects-issues spring-projects-issues added in: ldap An issue in spring-security-ldap Open type: enhancement A general enhancement type: jira An issue that was migrated from JIRA labels Feb 5, 2016
@rwinch rwinch removed the Open label May 3, 2019
@rwinch rwinch added the status: ideal-for-contribution An issue that we actively are looking for someone to help us with label May 25, 2021
@rwinch rwinch added this to the 5.6.x milestone May 25, 2021
@sodrac
Copy link

sodrac commented May 26, 2022

Hi @rwinch, I would like to work on this if the issue is still available.

@rwinch rwinch removed this from the 5.6.x milestone Jun 2, 2022
@sodrac
Copy link

sodrac commented Sep 18, 2022

Hi @rwinch, any update regarding this ticket? Thanks!

@jzheaux jzheaux self-assigned this Feb 12, 2024
@jzheaux jzheaux removed the status: ideal-for-contribution An issue that we actively are looking for someone to help us with label Feb 12, 2024
@jzheaux
Copy link
Contributor

jzheaux commented Feb 12, 2024

Closed in favor of #14574

@jzheaux jzheaux closed this as completed Feb 12, 2024
Haarolean added a commit to Haarolean/spring-security that referenced this issue Feb 27, 2024
jzheaux added a commit that referenced this issue Feb 29, 2024
@jzheaux jzheaux added the status: duplicate A duplicate of another issue label Feb 29, 2024
@jzheaux jzheaux modified the milestones: 6.2.x, 6.3.0-M3 Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: ldap An issue in spring-security-ldap status: duplicate A duplicate of another issue type: enhancement A general enhancement type: jira An issue that was migrated from JIRA
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants