Package jenkins.security
Class NonSerializableSecurityContext
- java.lang.Object
-
- jenkins.security.NonSerializableSecurityContext
-
- All Implemented Interfaces:
Serializable,org.springframework.security.core.context.SecurityContext
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class NonSerializableSecurityContext extends Object implements org.springframework.security.core.context.SecurityContext
The same asSecurityContextImplbut doesn't serializeAuthentication.Authenticationoften containsUserDetailsimplemented by a plugin, but when it's persisted as a part ofHttpSession, such instance will never de-serialize correctly because the container isn't aware of additional classloading in Jenkins.Jenkins doesn't work with a clustering anyway, and so it's better to just not persist Authentication at all. See the problem report.
- Since:
- 1.509
- Author:
- Kohsuke Kawaguchi
- See Also:
HttpSessionContextIntegrationFilter2, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NonSerializableSecurityContext()NonSerializableSecurityContext(org.springframework.security.core.Authentication authentication)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)org.springframework.security.core.AuthenticationgetAuthentication()inthashCode()voidsetAuthentication(org.springframework.security.core.Authentication authentication)StringtoString()
-
-
-
Method Detail
-
getAuthentication
public org.springframework.security.core.Authentication getAuthentication()
- Specified by:
getAuthenticationin interfaceorg.springframework.security.core.context.SecurityContext
-
setAuthentication
public void setAuthentication(org.springframework.security.core.Authentication authentication)
- Specified by:
setAuthenticationin interfaceorg.springframework.security.core.context.SecurityContext
-
-