parent
7ace9f2b7b
commit
372332e8dc
|
@ -16,6 +16,8 @@ import java.util.concurrent.ConcurrentMap;
|
||||||
/** author: Ranjith Manickam @ 20 Mar' 2020 */
|
/** author: Ranjith Manickam @ 20 Mar' 2020 */
|
||||||
public class SingleSignOnEntry implements Serializable {
|
public class SingleSignOnEntry implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 4590485271396917062L;
|
||||||
|
|
||||||
private String authType;
|
private String authType;
|
||||||
private String password;
|
private String password;
|
||||||
private Principal principal;
|
private Principal principal;
|
||||||
|
@ -79,22 +81,20 @@ public class SingleSignOnEntry implements Serializable {
|
||||||
|
|
||||||
public void writeObjectData(ObjectOutputStream out) throws IOException {
|
public void writeObjectData(ObjectOutputStream out) throws IOException {
|
||||||
try (ObjectOutputStream outputStream = new ObjectOutputStream(out)) {
|
try (ObjectOutputStream outputStream = new ObjectOutputStream(out)) {
|
||||||
if (this.principal instanceof Serializable) {
|
outputStream.writeObject(this);
|
||||||
outputStream.writeBoolean(true);
|
|
||||||
outputStream.writeObject(this.principal);
|
|
||||||
} else {
|
|
||||||
outputStream.writeBoolean(false);
|
|
||||||
}
|
|
||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readObjectData(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
public void readObjectData(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||||
try (ObjectInputStream inputStream = new ObjectInputStream(in)) {
|
try (ObjectInputStream inputStream = new ObjectInputStream(in)) {
|
||||||
boolean hasPrincipal = inputStream.readBoolean();
|
SingleSignOnEntry entry = (SingleSignOnEntry) inputStream.readObject();
|
||||||
if (hasPrincipal) {
|
this.authType = entry.authType;
|
||||||
this.principal = (Principal) inputStream.readObject();
|
this.password = entry.password;
|
||||||
}
|
this.principal = entry.principal;
|
||||||
|
this.username = entry.username;
|
||||||
|
this.canReauthenticate = entry.canReauthenticate;
|
||||||
|
this.sessionKeys.putAll(entry.sessionKeys);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -361,8 +361,11 @@ public class SessionManager extends ManagerBase implements Lifecycle {
|
||||||
/** To get single-sign-on entry from cache. */
|
/** To get single-sign-on entry from cache. */
|
||||||
SingleSignOnEntry getSingleSignOnEntry(String ssoId) {
|
SingleSignOnEntry getSingleSignOnEntry(String ssoId) {
|
||||||
byte[] data = this.dataCache.get(ssoId);
|
byte[] data = this.dataCache.get(ssoId);
|
||||||
SingleSignOnEntry entry = new SingleSignOnEntry();
|
if (data == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
SingleSignOnEntry entry = new SingleSignOnEntry();
|
||||||
try {
|
try {
|
||||||
this.serializer.deserializeSingleSignOnEntry(data, entry);
|
this.serializer.deserializeSingleSignOnEntry(data, entry);
|
||||||
} catch (IOException | ClassNotFoundException ex) {
|
} catch (IOException | ClassNotFoundException ex) {
|
||||||
|
|
Loading…
Reference in New Issue