Class ActiveDirectorySecurityRealm
- All Implemented Interfaces:
ExtensionPoint
,Describable<SecurityRealm>
SecurityRealm
that talks to Active Directory.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static class
Store all the extra environment variable to be used on the LDAP ContextNested classes/interfaces inherited from class hudson.security.SecurityRealm
SecurityRealm.SecurityComponents
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
FieldsModifier and TypeFieldDescriptionRepresent the old NameRepresent the old bindPasswordprotected CacheConfiguration
Cache of the Active Directory pluginRepresent the old Active Directory Domainstatic String
Deprecated.as of 1.28 Use the UI field.List ofActiveDirectoryDomain
Ldap extra propertiesprotected ActiveDirectoryInternalUsersDatabase
The Jenkins internal user to fall back in case fNamingException
final boolean
If true, Jenkins ignores Active Directory groups that are not being used by the active Authorization Strategy.Represent the old Active Directory Domain Controllersfinal String
Active directory site (which specifies the physical concentration of the servers), if any.If true enable startTls in case plain communication is used.protected TlsConfiguration
Deprecated.Fields inherited from class hudson.security.SecurityRealm
AUTHENTICATED_AUTHORITY, AUTHENTICATED_AUTHORITY2, LIST, NO_AUTHENTICATION
-
Constructor Summary
ConstructorsConstructorDescriptionActiveDirectorySecurityRealm
(String domain, String site, String bindName, String bindPassword, String server) ActiveDirectorySecurityRealm
(String domain, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy) ActiveDirectorySecurityRealm
(String domain, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups) ActiveDirectorySecurityRealm
(String domain, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, CacheConfiguration cache) ActiveDirectorySecurityRealm
(String domain, List<ActiveDirectoryDomain> domains, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache, Boolean startTls) ActiveDirectorySecurityRealm
(String domain, List<ActiveDirectoryDomain> domains, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache, Boolean startTls, ActiveDirectoryInternalUsersDatabase internalUsersDatabase) Deprecated.ActiveDirectorySecurityRealm
(String domain, List<ActiveDirectoryDomain> domains, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache, Boolean startTls, ActiveDirectoryInternalUsersDatabase internalUsersDatabase, boolean requireTLS) ActiveDirectorySecurityRealm
(String domain, List<ActiveDirectoryDomain> domains, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache, Boolean startTls, TlsConfiguration tlsConfiguration) ActiveDirectorySecurityRealm
(String domain, List<ActiveDirectoryDomain> domains, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache, Boolean startTls, TlsConfiguration tlsConfiguration, ActiveDirectoryInternalUsersDatabase internalUsersDatabase) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.security.core.userdetails.UserDetails
authenticate2
(String username, String password) void
doAuthTest
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String username, String password) Authentication test.getCache()
boolean
Get the @link{ActiveDirectoryDomain} given the domaingetSize()
Deprecated.getTtl()
boolean
loadGroupByGroupname2
(String groupname, boolean fetchMembers) org.springframework.security.core.userdetails.UserDetails
loadUserByUsername2
(String username) void
setEnvironmentProperties
(List<ActiveDirectorySecurityRealm.EnvironmentProperty> environmentProperties) Methods inherited from class hudson.security.AbstractPasswordBasedSecurityRealm
authenticate, authenticateByPassword, createSecurityComponents, loadGroupByGroupname, loadUserByUsername
Methods inherited from class hudson.security.SecurityRealm
all, allowsSignup, canLogOut, commenceSignup, commonFilters, createCliAuthenticator, createFilter, createFilter, doCaptcha, doLogout, doLogout, getAuthenticationGatewayUrl, getCaptchaSupport, getCaptchaSupportDescriptors, getFrom, getGroupIdStrategy, getLoginUrl, getPostLogOutUrl, getPostLogOutUrl2, getPostLogOutUrl2, getSecurityComponents, getUserIdStrategy, loadGroupByGroupname, setCaptchaSupport, validateCaptcha
-
Field Details
-
domain
Represent the old Active Directory DomainWe need to keep this as transient in order to be able to use readResolve to migrate the old descriptor to the newone.
This has been deprecated since
ActiveDirectoryDomain
-
server
Represent the old Active Directory Domain ControllersWe need to keep this as transient in order to be able to use readResolve to migrate the old descriptor to the newone.
This has been deprecated since
ActiveDirectoryDomain
-
domains
List ofActiveDirectoryDomain
-
site
Active directory site (which specifies the physical concentration of the servers), if any. If the value is non-null, we'll only contact servers in this site.On Windows, I'm assuming ADSI takes care of everything automatically.
We need to keep this as transient in order to be able to use readResolve to migrate the old descriptor to the newone.
-
bindName
Represent the old NameWe need to keep this as transient in order to be able to use readResolve to migrate the old descriptor to the new one.
This has been deprecated @since Jenkins 2.1
-
bindPassword
Represent the old bindPasswordWe need to keep this as transient in order to be able to use readResolve to migrate the old descriptor to the new one.
This has been deprecated @since Jenkins 2.1
-
startTls
If true enable startTls in case plain communication is used. In case the plugin is configured to use TLS then this option will not have any impact.- See Also:
-
removeIrrelevantGroups
public final boolean removeIrrelevantGroupsIf true, Jenkins ignores Active Directory groups that are not being used by the active Authorization Strategy. This can significantly improve performance in environments with a large number of groups but a small number of corresponding rules defined by the Authorization Strategy. Groups are considered as used if they are returned byAuthorizationStrategy.getGroups()
. -
cache
Cache of the Active Directory plugin -
environmentProperties
Ldap extra properties -
tlsConfiguration
Deprecated.Selects the SSL strategy to follow on the TLS connectionsEven if we are not using any of the TLS ports (3269/636) the plugin will try to establish a TLS channel using startTLS. Because of this, we need to be able to specify the SSL strategy on the plugin
For the moment there are two possible values: trustAllCertificates and trustStore.
-
internalUsersDatabase
The Jenkins internal user to fall back in case fNamingException
-
DOMAIN_CONTROLLERS
Deprecated.as of 1.28 Use the UI field.If non-null, this value specifies the domain controllers and overrides all the lookups. The format is "host:port,host:port,..."
-
-
Constructor Details
-
ActiveDirectorySecurityRealm
-
ActiveDirectorySecurityRealm
-
ActiveDirectorySecurityRealm
-
ActiveDirectorySecurityRealm
public ActiveDirectorySecurityRealm(String domain, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, CacheConfiguration cache) -
ActiveDirectorySecurityRealm
public ActiveDirectorySecurityRealm(String domain, List<ActiveDirectoryDomain> domains, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache, Boolean startTls) -
ActiveDirectorySecurityRealm
public ActiveDirectorySecurityRealm(String domain, List<ActiveDirectoryDomain> domains, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache, Boolean startTls, TlsConfiguration tlsConfiguration) -
ActiveDirectorySecurityRealm
@Deprecated public ActiveDirectorySecurityRealm(String domain, List<ActiveDirectoryDomain> domains, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache, Boolean startTls, TlsConfiguration tlsConfiguration, ActiveDirectoryInternalUsersDatabase internalUsersDatabase) Deprecated. -
ActiveDirectorySecurityRealm
@Deprecated public ActiveDirectorySecurityRealm(String domain, List<ActiveDirectoryDomain> domains, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache, Boolean startTls, ActiveDirectoryInternalUsersDatabase internalUsersDatabase) Deprecated. -
ActiveDirectorySecurityRealm
@DataBoundConstructor public ActiveDirectorySecurityRealm(String domain, List<ActiveDirectoryDomain> domains, String site, String bindName, String bindPassword, String server, GroupLookupStrategy groupLookupStrategy, boolean removeIrrelevantGroups, Boolean customDomain, CacheConfiguration cache, Boolean startTls, ActiveDirectoryInternalUsersDatabase internalUsersDatabase, boolean requireTLS)
-
-
Method Details
-
setEnvironmentProperties
@DataBoundSetter public void setEnvironmentProperties(List<ActiveDirectorySecurityRealm.EnvironmentProperty> environmentProperties) -
getCache
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public CacheConfiguration getCache() -
getJenkinsInternalUser
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getJenkinsInternalUser() -
getInternalUsersDatabase
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public ActiveDirectoryInternalUsersDatabase getInternalUsersDatabase() -
isStartTls
-
getRequireTLS
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @NonNull public Boolean getRequireTLS() -
isRequireTLSPersisted
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isRequireTLSPersisted() -
getSize
-
getTtl
-
getEnvironmentProperties
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<ActiveDirectorySecurityRealm.EnvironmentProperty> getEnvironmentProperties() -
getCustomDomain
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean getCustomDomain() -
getGroupLookupStrategy
-
getTlsConfiguration
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public TlsConfiguration getTlsConfiguration()Deprecated. -
getDomains
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<ActiveDirectoryDomain> getDomains() -
getDomain
Get the @link{ActiveDirectoryDomain} given the domain- Parameters:
domain
- The name of the Active Directory domain- Returns:
- the @link{ActiveDirectoryDomain} null if not exist.
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<SecurityRealm>
- Overrides:
getDescriptor
in classSecurityRealm
-
doAuthTest
public void doAuthTest(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String username, @QueryParameter String password) throws IOException, jakarta.servlet.ServletException Authentication test.- Throws:
IOException
jakarta.servlet.ServletException
-
readResolve
- Throws:
ObjectStreamException
-
loadGroupByGroupname2
public GroupDetails loadGroupByGroupname2(String groupname, boolean fetchMembers) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Overrides:
loadGroupByGroupname2
in classAbstractPasswordBasedSecurityRealm
- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-
loadUserByUsername2
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername2(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Overrides:
loadUserByUsername2
in classAbstractPasswordBasedSecurityRealm
- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-
authenticate2
protected org.springframework.security.core.userdetails.UserDetails authenticate2(String username, String password) throws org.springframework.security.core.AuthenticationException - Overrides:
authenticate2
in classAbstractPasswordBasedSecurityRealm
- Throws:
org.springframework.security.core.AuthenticationException
-