Class LegacySecurityRealm
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<SecurityRealm>
-
- hudson.security.SecurityRealm
-
- hudson.security.LegacySecurityRealm
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<SecurityRealm>
,org.springframework.security.authentication.AuthenticationManager
public final class LegacySecurityRealm extends SecurityRealm implements org.springframework.security.authentication.AuthenticationManager
SecurityRealm
that acceptsContainerAuthentication
object without any check (that is, by assuming that the such token is already authenticated by the container.)- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LegacySecurityRealm.DescriptorImpl
-
Nested classes/interfaces inherited from class hudson.security.SecurityRealm
SecurityRealm.SecurityComponents
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static Descriptor<SecurityRealm>
DESCRIPTOR
Deprecated.as of 2.0 Don't use this field, use injection.-
Fields inherited from class hudson.security.SecurityRealm
AUTHENTICATED_AUTHORITY, AUTHENTICATED_AUTHORITY2, LIST, NO_AUTHENTICATION
-
-
Constructor Summary
Constructors Constructor Description LegacySecurityRealm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.core.Authentication
authenticate(org.springframework.security.core.Authentication authentication)
javax.servlet.Filter
createFilter(javax.servlet.FilterConfig filterConfig)
CreatesFilter
that all the incoming HTTP requests will go through for authentication.SecurityRealm.SecurityComponents
createSecurityComponents()
Creates fully-configuredAuthenticationManager
that performs authentication against the user realm.String
getAuthenticationGatewayUrl()
To have the username/password authenticated by the container, submit the form to the URL defined by the servlet spec.String
getLoginUrl()
Gets the target URL of the "login" link.-
Methods inherited from class hudson.security.SecurityRealm
all, allowsSignup, canLogOut, commenceSignup, commonFilters, createCliAuthenticator, doCaptcha, doLogout, getCaptchaSupport, getCaptchaSupportDescriptors, getDescriptor, getFrom, getGroupIdStrategy, getPostLogOutUrl, getPostLogOutUrl2, getSecurityComponents, getUserIdStrategy, loadGroupByGroupname, loadGroupByGroupname, loadGroupByGroupname2, loadUserByUsername, loadUserByUsername2, setCaptchaSupport, validateCaptcha
-
-
-
-
Field Detail
-
DESCRIPTOR
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static Descriptor<SecurityRealm> DESCRIPTOR
Deprecated.as of 2.0 Don't use this field, use injection.
-
-
Method Detail
-
createSecurityComponents
public SecurityRealm.SecurityComponents createSecurityComponents()
Description copied from class:SecurityRealm
Creates fully-configuredAuthenticationManager
that performs authentication against the user realm. The implementation hides how such authentication manager is configured.AuthenticationManager
instantiation often depends on the user-specified parameters (for example, if the authentication is based on LDAP, the user needs to specify the host name of the LDAP server.) Such configuration is expected to be presented to the user viaconfig.jelly
and then captured as instance variables inside theSecurityRealm
implementation.Your
SecurityRealm
may also wants to alterFilter
set up by overridingSecurityRealm.createFilter(FilterConfig)
.- Specified by:
createSecurityComponents
in classSecurityRealm
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
- Specified by:
authenticate
in interfaceorg.springframework.security.authentication.AuthenticationManager
- Throws:
org.springframework.security.core.AuthenticationException
-
getAuthenticationGatewayUrl
public String getAuthenticationGatewayUrl()
To have the username/password authenticated by the container, submit the form to the URL defined by the servlet spec.- Overrides:
getAuthenticationGatewayUrl
in classSecurityRealm
- See Also:
AuthenticationProcessingFilter2
-
getLoginUrl
public String getLoginUrl()
Description copied from class:SecurityRealm
Gets the target URL of the "login" link. There's no need to override this, except forLegacySecurityRealm
. On legacy implementation this should point tologinEntry
, which is protected byweb.xml
, so that the user can be eventually authenticated by the container.Path is relative from the context root of the Hudson application. The URL returned by this method will get the "from" query parameter indicating the page that the user was at.
- Overrides:
getLoginUrl
in classSecurityRealm
-
createFilter
public javax.servlet.Filter createFilter(javax.servlet.FilterConfig filterConfig)
Description copied from class:SecurityRealm
CreatesFilter
that all the incoming HTTP requests will go through for authentication.The default implementation uses
SecurityRealm.getSecurityComponents()
and builds a standard filter chain. But subclasses can override this to completely change the filter sequence.For other plugins that want to contribute
Filter
, seePluginServletFilter
.- Overrides:
createFilter
in classSecurityRealm
-
-