changes to support single-sign-on (sso)

master
Ranjith Manickam 2020-04-08 20:57:07 +05:30
parent 80acc01418
commit 0ecdfc2661
1 changed files with 11 additions and 6 deletions

View File

@ -78,16 +78,21 @@ public class SingleSignOnEntry implements Serializable {
} }
public void writeObjectData(ObjectOutputStream out) throws IOException { public void writeObjectData(ObjectOutputStream out) throws IOException {
out.defaultWriteObject(); ObjectOutputStream outputStream = new ObjectOutputStream(out);
out.writeBoolean(true); if (this.principal instanceof Serializable) {
out.writeObject(this.principal); outputStream.writeBoolean(true);
outputStream.writeObject(this.principal);
} else {
outputStream.writeBoolean(false);
}
outputStream.flush();
} }
public void readObjectData(ObjectInputStream in) throws IOException, ClassNotFoundException { public void readObjectData(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject(); ObjectInputStream inputStream = new ObjectInputStream(in);
boolean hasPrincipal = in.readBoolean(); boolean hasPrincipal = inputStream.readBoolean();
if (hasPrincipal) { if (hasPrincipal) {
this.principal = (Principal) in.readObject(); this.principal = (Principal) inputStream.readObject();
} }
} }
} }