Skip to content

Commit

Permalink
Handle NPE in SLO request flow
Browse files Browse the repository at this point in the history
  • Loading branch information
AfraHussaindeen committed Jan 3, 2024
1 parent d2dc915 commit ea69e72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public FrameworkLogoutResponse.FrameworkLogoutResponseBuilder process(IdentityRe
populateContextWithSessionDetails(samlMessageContext, logoutRequest);
}

if (!Boolean.parseBoolean(samlMessageContext.getFedIdPConfigs().get(IdentityApplicationConstants.
if (!Boolean.parseBoolean((String) samlMessageContext.getFedIdPConfigs().get(IdentityApplicationConstants.
Authenticator.SAML2SSO.IS_SLO_REQUEST_ACCEPTED))) {
throw new SAMLLogoutException("Single logout requests from the federated IdP: "
+ samlMessageContext.getFederatedIdP().getIdentityProviderName() + " are not accepted");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ public static LogoutResponse buildResponse(SAMLMessageContext samlMessageContext
doBootstrap();
String issuerID = (String) samlMessageContext.getFedIdPConfigs().get(SP_ENTITY_ID);
String acsUrl = (String) samlMessageContext.getFedIdPConfigs().get(SSO_URL);
boolean isResponseSigned = Boolean.parseBoolean(samlMessageContext.getFedIdPConfigs().
get(IS_AUTHN_RESP_SIGNED).toString());
boolean isIncludeCert = Boolean.parseBoolean(samlMessageContext.getFedIdPConfigs().
get(INCLUDE_CERT).toString());
boolean isResponseSigned = Boolean.parseBoolean((String) samlMessageContext.getFedIdPConfigs().
get(IS_AUTHN_RESP_SIGNED));
boolean isIncludeCert = Boolean.parseBoolean((String) samlMessageContext.getFedIdPConfigs().
get(INCLUDE_CERT));

LogoutResponse logoutResp = new LogoutResponseBuilder().buildObject();
logoutResp.setID(createID());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private void isSubjectValid(LogoutRequest logoutRequest) throws SAMLLogoutExcept
*/
private void isValidLogoutReqSignature(LogoutRequest logoutRequest) throws SAMLLogoutException {

if (Boolean.parseBoolean(samlMessageContext.getFedIdPConfigs().get(IS_LOGOUT_REQ_SIGNED).toString()) &&
if (Boolean.parseBoolean((String) samlMessageContext.getFedIdPConfigs().get(IS_LOGOUT_REQ_SIGNED)) &&
(!SAMLLogoutUtil.isValidSignature(logoutRequest, samlMessageContext))) {
String notification = "Signature validation failed for logout request with issuer: "
+ logoutRequest.getIssuer().getValue();
Expand Down

0 comments on commit ea69e72

Please sign in to comment.