Package de.theit.jenkins.crowd
Class CrowdSecurityRealm
java.lang.Object
hudson.model.AbstractDescribableImpl<SecurityRealm>
hudson.security.SecurityRealm
hudson.security.AbstractPasswordBasedSecurityRealm
de.theit.jenkins.crowd.CrowdSecurityRealm
- All Implemented Interfaces:
ExtensionPoint,Describable<SecurityRealm>
This class provides the security realm for authenticating users against a
remote Crowd server.
- Since:
- 06.09.2011
- Version:
- $Id$
- Author:
- Thorsten Heit (theit@gmx.de)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classDescriptor forCrowdSecurityRealm.Nested classes/interfaces inherited from class hudson.security.SecurityRealm
SecurityRealm.SecurityComponentsNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringContains the application name to access Crowd.final StringA domain to use when setting cookies, overriding the SSO Domain set in Crowd (since Crowd 2.5.2).final StringSSO cookie name for application.final StringContains the Crowd group to which a user must belong to.final Stringfinal Stringfinal Secretfinal Stringfinal Stringfinal Stringfinal booleanSpecifies whether nested groups can be used.final SecretContains the application password to access Crowd.final intThe number of minutes to cache authentication validation in the session.final Stringfinal StringContains the Crowd server URL.final Booleanfinal booleanDon't use SSO, only REST API authentication.Fields inherited from class hudson.security.SecurityRealm
AUTHENTICATED_AUTHORITY, AUTHENTICATED_AUTHORITY2, LIST, NO_AUTHENTICATION -
Constructor Summary
ConstructorsConstructorDescriptionCrowdSecurityRealm(String url, String applicationName, Secret password, String group, boolean nestedGroups, int sessionValidationInterval, boolean useSSO, String cookieDomain, String cookieTokenkey, Boolean useProxy, String httpProxyHost, String httpProxyPort, String httpProxyUsername, Secret httpProxyPassword, String socketTimeout, String httpTimeout, String httpMaxConnections, CrowdSecurityRealm.CacheConfiguration cache) Default constructor.CrowdSecurityRealm(String url, String applicationName, String password, String group, boolean nestedGroups, int sessionValidationInterval, boolean useSSO, String cookieDomain, String cookieTokenkey, Boolean useProxy, String httpProxyHost, String httpProxyPort, String httpProxyUsername, String httpProxyPassword, String socketTimeout, String httpTimeout, String httpMaxConnections) Deprecated.retained for backwards binary compatibility.CrowdSecurityRealm(String url, String applicationName, String password, String group, boolean nestedGroups, int sessionValidationInterval, boolean useSSO, String cookieDomain, String cookieTokenkey, Boolean useProxy, String httpProxyHost, String httpProxyPort, String httpProxyUsername, String httpProxyPassword, String socketTimeout, String httpTimeout, String httpMaxConnections, CrowdSecurityRealm.CacheConfiguration cache) Deprecated.retained for backwards binary compatibility. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.security.core.userdetails.UserDetailsauthenticate2(String pUsername, String pPassword) javax.servlet.FiltercreateFilter(javax.servlet.FilterConfig filterConfig) voiddoLogout(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) getCache()loadGroupByGroupname(String groupname) loadGroupByGroupname(String groupname, boolean fetchMembers) loadUserByUsername(String username) Deprecated.org.springframework.security.core.userdetails.UserDetailsloadUserByUsername2(String username) Methods inherited from class hudson.security.AbstractPasswordBasedSecurityRealm
authenticate, loadGroupByGroupname2Methods inherited from class hudson.security.SecurityRealm
all, allowsSignup, canLogOut, commenceSignup, commonFilters, createCliAuthenticator, doCaptcha, getAuthenticationGatewayUrl, getCaptchaSupport, getCaptchaSupportDescriptors, getDescriptor, getFrom, getGroupIdStrategy, getLoginUrl, getPostLogOutUrl, getPostLogOutUrl2, getSecurityComponents, getUserIdStrategy, setCaptchaSupport, validateCaptcha
-
Field Details
-
url
Contains the Crowd server URL. -
applicationName
Contains the application name to access Crowd. -
password
Contains the application password to access Crowd. -
group
Contains the Crowd group to which a user must belong to. -
nestedGroups
public final boolean nestedGroupsSpecifies whether nested groups can be used. -
useSSO
public final boolean useSSODon't use SSO, only REST API authentication. -
sessionValidationInterval
public final int sessionValidationIntervalThe number of minutes to cache authentication validation in the session. If this value is set to 0, each HTTP request will be authenticated with the Crowd server. -
cookieDomain
A domain to use when setting cookies, overriding the SSO Domain set in Crowd (since Crowd 2.5.2). cookie.domain details -
cookieTokenkey
SSO cookie name for application. cookie.tokenkey details -
useProxy
-
httpProxyHost
-
httpProxyPort
-
httpProxyUsername
-
httpProxyPassword
-
socketTimeout
-
httpTimeout
-
httpMaxConnections
-
-
Constructor Details
-
CrowdSecurityRealm
@DataBoundConstructor public CrowdSecurityRealm(String url, String applicationName, Secret password, String group, boolean nestedGroups, int sessionValidationInterval, boolean useSSO, String cookieDomain, String cookieTokenkey, Boolean useProxy, String httpProxyHost, String httpProxyPort, String httpProxyUsername, Secret httpProxyPassword, String socketTimeout, String httpTimeout, String httpMaxConnections, CrowdSecurityRealm.CacheConfiguration cache) Default constructor. Fields in config.jelly must match the parameter names in the "DataBoundConstructor".- Parameters:
url- The URL for Crowd.applicationName- The application name.password- The application password.group- The group to which users must belong to. If this parameter is not specified, a users group membership will not be checked.nestedGroups-truewhen nested groups may be used.falseelse.sessionValidationInterval- The number of minutes to cache authentication validation in the session. If this value is set to0, each HTTP request will be authenticated with the Crowd server.useSSO- Enable SSO authentication.cookieDomain- The cookie domaincookieTokenkey- The cookie token keyuseProxy- Specifies if a proxy should be usedhttpProxyHost- The http proxy hosthttpProxyPort- The http proxy porthttpProxyUsername- The http proxy usernamehttpProxyPassword- The http proxy passwordsocketTimeout- The socket timeouthttpTimeout- The http timeouthttpMaxConnections- The http max connectionscache- The cache configuration
-
CrowdSecurityRealm
@Deprecated public CrowdSecurityRealm(String url, String applicationName, String password, String group, boolean nestedGroups, int sessionValidationInterval, boolean useSSO, String cookieDomain, String cookieTokenkey, Boolean useProxy, String httpProxyHost, String httpProxyPort, String httpProxyUsername, String httpProxyPassword, String socketTimeout, String httpTimeout, String httpMaxConnections, CrowdSecurityRealm.CacheConfiguration cache) Deprecated.retained for backwards binary compatibility.Default constructor. Fields in config.jelly must match the parameter names in the "DataBoundConstructor".- Parameters:
url- The URL for Crowd.applicationName- The application name.password- The application password.group- The group to which users must belong to. If this parameter is not specified, a users group membership will not be checked.nestedGroups-truewhen nested groups may be used.falseelse.sessionValidationInterval- The number of minutes to cache authentication validation in the session. If this value is set to0, each HTTP request will be authenticated with the Crowd server.useSSO- Enable SSO authentication.cookieDomain- The cookie domaincookieTokenkey- The cookie token keyuseProxy- Specifies if a proxy should be usedhttpProxyHost- The http proxy hosthttpProxyPort- The http proxy porthttpProxyUsername- The http proxy usernamehttpProxyPassword- The http proxy passwordsocketTimeout- The socket timeouthttpTimeout- The http timeouthttpMaxConnections- The http max connectionscache- The cache configuration
-
CrowdSecurityRealm
@Deprecated public CrowdSecurityRealm(String url, String applicationName, String password, String group, boolean nestedGroups, int sessionValidationInterval, boolean useSSO, String cookieDomain, String cookieTokenkey, Boolean useProxy, String httpProxyHost, String httpProxyPort, String httpProxyUsername, String httpProxyPassword, String socketTimeout, String httpTimeout, String httpMaxConnections) Deprecated.retained for backwards binary compatibility.Fields in config.jelly must match the parameter names in the "DataBoundConstructor".- Parameters:
url- The URL for Crowd.applicationName- The application name.password- The application password.group- The group to which users must belong to. If this parameter is not specified, a users group membership will not be checked.nestedGroups-truewhen nested groups may be used.falseelse.sessionValidationInterval- The number of minutes to cache authentication validation in the session. If this value is set to0, each HTTP request will be authenticated with the Crowd server.useSSO- Enable SSO authentication.cookieDomain- The cookie domaincookieTokenkey- The cookie token keyuseProxy- Specifies if a proxy should be usedhttpProxyHost- The http proxy hosthttpProxyPort- The http proxy porthttpProxyUsername- The http proxy usernamehttpProxyPassword- The http proxy passwordsocketTimeout- The socket timeouthttpTimeout- The http timeouthttpMaxConnections- The http max connections
-
-
Method Details
-
getCache
-
getCacheSize
-
getCacheTTL
-
createSecurityComponents
- Overrides:
createSecurityComponentsin classAbstractPasswordBasedSecurityRealm- See Also:
-
doLogout
@POST public void doLogout(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException - Overrides:
doLogoutin classSecurityRealm- Throws:
IOExceptionjavax.servlet.ServletException- See Also:
-
createFilter
public javax.servlet.Filter createFilter(javax.servlet.FilterConfig filterConfig) - Overrides:
createFilterin classSecurityRealm- See Also:
-
loadUserByUsername
@Deprecated public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException Deprecated.- Overrides:
loadUserByUsernamein classAbstractPasswordBasedSecurityRealm- Throws:
UsernameNotFoundExceptionDataAccessException- See Also:
-
loadUserByUsername2
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername2(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException - Overrides:
loadUserByUsername2in classAbstractPasswordBasedSecurityRealm- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException- See Also:
-
loadGroupByGroupname
@Deprecated public GroupDetails loadGroupByGroupname(String groupname, boolean fetchMembers) throws UsernameNotFoundException, DataAccessException - Overrides:
loadGroupByGroupnamein classSecurityRealm- Throws:
UsernameNotFoundExceptionDataAccessException- Since:
- 1.549
- See Also:
-
loadGroupByGroupname
@Deprecated public GroupDetails loadGroupByGroupname(String groupname) throws UsernameNotFoundException, DataAccessException -
authenticate2
protected org.springframework.security.core.userdetails.UserDetails authenticate2(String pUsername, String pPassword) throws org.springframework.security.core.AuthenticationException - Overrides:
authenticate2in classAbstractPasswordBasedSecurityRealm- Throws:
org.springframework.security.core.AuthenticationException- See Also:
-