Class ReverseProxySecurityRealm
java.lang.Object
hudson.model.AbstractDescribableImpl<SecurityRealm>
hudson.security.SecurityRealm
org.jenkinsci.plugins.reverse_proxy_auth.ReverseProxySecurityRealm
- All Implemented Interfaces:
ExtensionPoint,Describable<SecurityRealm>
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from class hudson.security.SecurityRealm
SecurityRealm.SecurityComponentsNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionCollection<? extends org.springframework.security.core.GrantedAuthority>The authorities that are granted to the authenticated user.final StringCustom post logout urlfinal Stringfinal booleanfinal StringThe name of the header which the display name has to be extracted from.final StringThe name of the header which the email has to be extracted from.final StringThe name of the header which the username has to be extracted from.static StringLDAP filter to look for groups by their names.final StringQuery to locate the group entries that a user belongs to, given the user object.Attribute that should be used instead of CN as name to match a users group name to the groupSearchFilter name.final StringThis defines the organizational unit that contains groups.final StringQuery to locate an entry that identifies the group, given the group name string.final StringHeader name of the groups field.final StringHeader name of the groups delimiter field.final booleanAllow the rootDN to be inferred? Default is false.final StringIf non-null, we use this andmanagerPasswordSecretwhen binding to LDAP.The username retrieved from the header field, which is represented by the forwardedUser attribute.final StringThe root DN to connect to.final StringLDAP server name(s) separated by spaces, optionally with TCP port number, like "ldap.acme.org" or "ldap.acme.org:389" and/or with protcol, like "ldap://ldap.acme.org".final intSets an interval for updating the LDAP authorities.final StringQuery to locate an entry that identifies the user, given the user name string.final StringSpecifies the relative DN fromthe root DN.Fields inherited from class hudson.security.SecurityRealm
AUTHENTICATED_AUTHORITY, AUTHENTICATED_AUTHORITY2, LIST, NO_AUTHENTICATION -
Constructor Summary
ConstructorsConstructorDescriptionReverseProxySecurityRealm(String forwardedUser, String forwardedEmail, String forwardedDisplayName, String headerGroups, String headerGroupsDelimiter, String customLogInUrl, String customLogOutUrl, String server, String rootDN, boolean inhibitInferRootDN, String userSearchBase, String userSearch, String groupSearchBase, String groupSearchFilter, String groupMembershipFilter, String groupNameAttribute, String managerDN, Secret managerPassword, Integer updateInterval, boolean disableLdapEmailResolver, String displayNameLdapAttribute, String emailAddressLdapAttribute) -
Method Summary
Modifier and TypeMethodDescriptionbooleanjakarta.servlet.FiltercreateFilter(jakarta.servlet.FilterConfig filterConfig) Name of the HTTP header to look at.getPostLogOutUrl2(org.kohsuke.stapler.StaplerRequest2 req, org.springframework.security.core.Authentication auth) intloadGroupByGroupname2(String groupname, boolean fetchMembers) org.springframework.security.core.userdetails.UserDetailsloadUserByUsername2(String username) protected ObjectvoidsetGroupNameAttribute(String groupNameAttribute) static StringtoProviderUrl(String serverUrl, String rootDN) org.springframework.security.ldap.userdetails.LdapUserDetailsupdateLdapUserDetails(org.springframework.security.ldap.userdetails.LdapUserDetails d, org.springframework.security.ldap.search.LdapUserSearch ldapUserSearch) Methods inherited from class hudson.security.SecurityRealm
all, allowsSignup, commenceSignup, commonFilters, createCliAuthenticator, createFilter, doCaptcha, doLogout, doLogout, getAuthenticationGatewayUrl, getCaptchaSupport, getCaptchaSupportDescriptors, getDescriptor, getFrom, getGroupIdStrategy, getLoginUrl, getPostLogOutUrl, getPostLogOutUrl2, getSecurityComponents, getUserIdStrategy, loadGroupByGroupname, loadGroupByGroupname, loadUserByUsername, setCaptchaSupport, validateCaptcha
-
Field Details
-
GROUP_SEARCH
LDAP filter to look for groups by their names."{0}" is the group name as given by the user. See http://msdn.microsoft.com/en-us/library/aa746475(VS.85).aspx for the syntax by example. WANTED: The specification of the syntax.
-
forwardedEmail
The name of the header which the email has to be extracted from. -
forwardedDisplayName
The name of the header which the display name has to be extracted from. -
server
LDAP server name(s) separated by spaces, optionally with TCP port number, like "ldap.acme.org" or "ldap.acme.org:389" and/or with protcol, like "ldap://ldap.acme.org". -
rootDN
The root DN to connect to. Normally something like "dc=sun,dc=com"How do I infer this?
-
inhibitInferRootDN
public final boolean inhibitInferRootDNAllow the rootDN to be inferred? Default is false. If true, allow rootDN to be blank. -
userSearchBase
Specifies the relative DN fromthe root DN. This is used to narrow down the search space when doing user search.Something like "ou=people" but can be empty.
-
userSearch
Query to locate an entry that identifies the user, given the user name string.Normally "uid={0}"
- See Also:
-
FilterBasedLdapUserSearch
-
groupSearchBase
This defines the organizational unit that contains groups.Normally "" to indicate the full LDAP search, but can be often narrowed down to something like "ou=groups"
- See Also:
-
FilterBasedLdapUserSearch
-
groupSearchFilter
Query to locate an entry that identifies the group, given the group name string. If non-null it will override the default specified byGROUP_SEARCH- Since:
- 1.5
-
groupMembershipFilter
Query to locate the group entries that a user belongs to, given the user object.{0}is the user's full DN while {1} is the username. -
groupNameAttribute
Attribute that should be used instead of CN as name to match a users group name to the groupSearchFilter name. WhengroupSearchFilteris set to search for a field other than CN e.g.GroupDisplayName={0}here you can configure that this (GroupDisplayName) or another field should be used when looking for a users groups. -
managerDN
If non-null, we use this andmanagerPasswordSecretwhen binding to LDAP.This is necessary when LDAP doesn't support anonymous access.
-
updateInterval
public final int updateIntervalSets an interval for updating the LDAP authorities. The interval is specified in minutes. -
authorities
public transient Collection<? extends org.springframework.security.core.GrantedAuthority> authoritiesThe authorities that are granted to the authenticated user. It is not necessary, that the authorities will be stored in the config.xml, they blow up the config.xml -
forwardedUser
The name of the header which the username has to be extracted from. -
retrievedUser
The username retrieved from the header field, which is represented by the forwardedUser attribute. -
headerGroups
Header name of the groups field. -
headerGroupsDelimiter
Header name of the groups delimiter field. -
disableLdapEmailResolver
public final boolean disableLdapEmailResolver -
customLogInUrl
Custom post logout url -
customLogOutUrl
-
-
Constructor Details
-
ReverseProxySecurityRealm
@DataBoundConstructor public ReverseProxySecurityRealm(String forwardedUser, String forwardedEmail, String forwardedDisplayName, String headerGroups, String headerGroupsDelimiter, String customLogInUrl, String customLogOutUrl, String server, String rootDN, boolean inhibitInferRootDN, String userSearchBase, String userSearch, String groupSearchBase, String groupSearchFilter, String groupMembershipFilter, String groupNameAttribute, String managerDN, Secret managerPassword, Integer updateInterval, boolean disableLdapEmailResolver, String displayNameLdapAttribute, String emailAddressLdapAttribute)
-
-
Method Details
-
getForwardedUser
Name of the HTTP header to look at. -
getHeaderGroups
-
getHeaderGroupsDelimiter
-
getServerUrl
-
getGroupSearchFilter
-
getGroupMembershipFilter
-
getGroupNameAttribute
-
setGroupNameAttribute
-
getDisplayNameLdapAttribute
-
getEmailAddressLdapAttribute
-
readResolve
-
toProviderUrl
-
getManagerPassword
-
getUpdateInterval
public int getUpdateInterval() -
getLDAPURL
-
createFilter
public jakarta.servlet.Filter createFilter(jakarta.servlet.FilterConfig filterConfig) - Overrides:
createFilterin classSecurityRealm
-
canLogOut
public boolean canLogOut()- Overrides:
canLogOutin classSecurityRealm
-
getPostLogOutUrl2
public String getPostLogOutUrl2(org.kohsuke.stapler.StaplerRequest2 req, org.springframework.security.core.Authentication auth) - Overrides:
getPostLogOutUrl2in classSecurityRealm
-
createSecurityComponents
- Specified by:
createSecurityComponentsin classSecurityRealm- Throws:
DataAccessException
-
loadUserByUsername2
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername2(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Overrides:
loadUserByUsername2in classSecurityRealm- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-
updateLdapUserDetails
public org.springframework.security.ldap.userdetails.LdapUserDetails updateLdapUserDetails(org.springframework.security.ldap.userdetails.LdapUserDetails d, @CheckForNull org.springframework.security.ldap.search.LdapUserSearch ldapUserSearch) -
loadGroupByGroupname2
public GroupDetails loadGroupByGroupname2(String groupname, boolean fetchMembers) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Overrides:
loadGroupByGroupname2in classSecurityRealm- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-