File tree 1 file changed +11
-2
lines changed
ldap/src/main/java/org/springframework/security/ldap/userdetails
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2022 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -104,7 +104,7 @@ public class LdapUserDetailsManager implements UserDetailsManager {
104
104
/** The attribute which contains members of a group */
105
105
private String groupMemberAttributeName = "uniquemember" ;
106
106
107
- private final String rolePrefix = "ROLE_" ;
107
+ private String rolePrefix = "ROLE_" ;
108
108
109
109
/** The pattern to be used for the user search. {0} is the user's DN */
110
110
private String groupSearchFilter = "(uniquemember={0})" ;
@@ -403,6 +403,15 @@ public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy secur
403
403
this .securityContextHolderStrategy = securityContextHolderStrategy ;
404
404
}
405
405
406
+ /**
407
+ * Sets the role prefix used when converting authorities. The default value is "ROLE_"
408
+ * @param rolePrefix role prefix
409
+ * @since 6.3
410
+ */
411
+ public void setRolePrefix (String rolePrefix ) {
412
+ this .rolePrefix = rolePrefix ;
413
+ }
414
+
406
415
private void changePasswordUsingAttributeModification (DistinguishedName userDn , String oldPassword ,
407
416
String newPassword ) {
408
417
ModificationItem [] passwordChange = new ModificationItem [] { new ModificationItem (DirContext .REPLACE_ATTRIBUTE ,
You can’t perform that action at this time.
0 commit comments