Author: mposolda
Date: 2012-01-17 07:03:40 -0500 (Tue, 17 Jan 2012)
New Revision: 1342
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java
Log:
PLFED-254 - Fix nonSerializable exception during cluster profile
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java
===================================================================
---
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java 2012-01-11
18:16:30 UTC (rev 1341)
+++
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java 2012-01-17
12:03:40 UTC (rev 1342)
@@ -21,6 +21,7 @@
*/
package org.picketlink.identity.federation.web.handlers.saml2;
+import java.io.Serializable;
import java.io.StringWriter;
import java.security.Principal;
import java.security.PrivateKey;
@@ -518,13 +519,7 @@
response.setRoles(roles);
- Principal principal = new Principal()
- {
- public String getName()
- {
- return userName;
- }
- };
+ Principal principal = new SerializablePrincipal(userName);
if (handlerChainConfig.getParameter(GeneralConstants.ROLE_VALIDATOR_IGNORE) ==
null)
{
@@ -605,4 +600,21 @@
return roles;
}
}
+
+ private class SerializablePrincipal implements Principal, Serializable
+ {
+ private static final long serialVersionUID = 7701951188631723253L;
+
+ private String userName;
+
+ private SerializablePrincipal(String userName)
+ {
+ this.userName = userName;
+ }
+
+ public String getName()
+ {
+ return userName;
+ }
+ }
}
\ No newline at end of file
Show replies by date