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 asSecurityContextImpl
but doesn't serializeAuthentication
.Authentication
often containsUserDetails
implemented 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 boolean
equals(Object obj)
org.springframework.security.core.Authentication
getAuthentication()
int
hashCode()
void
setAuthentication(org.springframework.security.core.Authentication authentication)
String
toString()
-
-
-
Method Detail
-
getAuthentication
public org.springframework.security.core.Authentication getAuthentication()
- Specified by:
getAuthentication
in interfaceorg.springframework.security.core.context.SecurityContext
-
setAuthentication
public void setAuthentication(org.springframework.security.core.Authentication authentication)
- Specified by:
setAuthentication
in interfaceorg.springframework.security.core.context.SecurityContext
-
-