Skip to content

Commit

Permalink
Fix custom Principal deserialization (magro#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
jungm committed Feb 14, 2022
1 parent 716e147 commit a808cfb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.apache.catalina.Session;
import org.apache.catalina.authenticator.Constants;
import org.apache.catalina.authenticator.SavedRequest;
import org.apache.catalina.util.CustomObjectInputStream;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.buf.ByteChunk;
Expand Down Expand Up @@ -361,7 +362,7 @@ private static Principal deserializePrincipal( final byte[] data, final SessionM
ObjectInputStream ois = null;
try {
bis = new ByteArrayInputStream( data );
ois = new ObjectInputStream( bis );
ois = new CustomObjectInputStream( bis, manager.getContainerClassLoader() );
return manager.readPrincipal( ois );
} catch ( final IOException e ) {
throw new IllegalArgumentException( "Could not deserialize principal", e );
Expand Down

0 comments on commit a808cfb

Please sign in to comment.