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
Modifier and TypeClassDescriptionstatic class
static class
Nested classes/interfaces inherited from class hudson.security.SecurityRealm
SecurityRealm.SecurityComponents
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Modifier and TypeFieldDescriptionCollection<? extends org.springframework.security.core.GrantedAuthority>
The authorities that are granted to the authenticated user.final String
Custom post logout urlfinal String
final boolean
final String
The name of the header which the display name has to be extracted from.final String
The name of the header which the email has to be extracted from.final String
The name of the header which the username has to be extracted from.static String
LDAP filter to look for groups by their names.final String
Query 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 String
This defines the organizational unit that contains groups.final String
Query to locate an entry that identifies the group, given the group name string.final String
Header name of the groups field.final String
Header name of the groups delimiter field.final boolean
Allow the rootDN to be inferred? Default is false.final String
If non-null, we use this andmanagerPasswordSecret
when binding to LDAP.The username retrieved from the header field, which is represented by the forwardedUser attribute.final String
The root DN to connect to.final String
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".final int
Sets an interval for updating the LDAP authorities.final String
Query to locate an entry that identifies the user, given the user name string.final String
Specifies the relative DN fromthe root DN
.Fields inherited from class hudson.security.SecurityRealm
AUTHENTICATED_AUTHORITY, AUTHENTICATED_AUTHORITY2, LIST, NO_AUTHENTICATION
-
Constructor Summary
ConstructorDescriptionReverseProxySecurityRealm
(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 TypeMethodDescriptionboolean
jakarta.servlet.Filter
createFilter
(jakarta.servlet.FilterConfig filterConfig) Name of the HTTP header to look at.getPostLogOutUrl2
(org.kohsuke.stapler.StaplerRequest2 req, org.springframework.security.core.Authentication auth) int
loadGroupByGroupname2
(String groupname, boolean fetchMembers) org.springframework.security.core.userdetails.UserDetails
loadUserByUsername2
(String username) protected Object
void
setGroupNameAttribute
(String groupNameAttribute) static String
toProviderUrl
(String serverUrl, String rootDN) org.springframework.security.ldap.userdetails.LdapUserDetails
updateLdapUserDetails
(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. WhengroupSearchFilter
is 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 andmanagerPasswordSecret
when 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:
createFilter
in classSecurityRealm
-
canLogOut
public boolean canLogOut()- Overrides:
canLogOut
in classSecurityRealm
-
getPostLogOutUrl2
public String getPostLogOutUrl2(org.kohsuke.stapler.StaplerRequest2 req, org.springframework.security.core.Authentication auth) - Overrides:
getPostLogOutUrl2
in classSecurityRealm
-
createSecurityComponents
- Specified by:
createSecurityComponents
in classSecurityRealm
- Throws:
DataAccessException
-
loadUserByUsername2
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername2(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Overrides:
loadUserByUsername2
in 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:
loadGroupByGroupname2
in classSecurityRealm
- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-