Merge pull request #3391 from pulgupta/master

Null pointer exception after users logs in
This commit is contained in:
Bill Burke 2016-10-20 16:06:30 -04:00 committed by GitHub
commit e1a214351f

View file

@ -153,14 +153,14 @@ public class CatalinaSamlSessionStore implements SamlSessionStore {
}
GenericPrincipal principal = (GenericPrincipal) session.getPrincipal();
if (samlSession.getPrincipal().getName().equals(principal.getName()))
// in clustered environment in JBossWeb, principal is not serialized or saved
if (principal == null) {
principal = principalFactory.createPrincipal(request.getContext().getRealm(), samlSession.getPrincipal(), samlSession.getRoles());
session.setPrincipal(principal);
session.setAuthType("KEYCLOAK-SAML");
} else {
}
else if (samlSession.getPrincipal().getName().equals(principal.getName())){
if (!principal.getUserPrincipal().getName().equals(samlSession.getPrincipal().getName())) {
throw new RuntimeException("Unknown State");
}