Skip to content

Commit

Permalink
Merge pull request #399 from ImalshaG/resp-sign-idp
Browse files Browse the repository at this point in the history
Add doSignResponse property to session during IDP Initiated SSO Flow
  • Loading branch information
ImalshaG authored Jul 28, 2023
2 parents 6826ee6 + 391e341 commit 483d9d1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public class SAMLSSOConstants {
public static final String SAML2_AUTHENTICATION_REQUEST_VALIDITY_PERIOD_ENABLED = "SSOService.SAML2AuthenticationRequestValidityPeriodEnabled";
public static final String SAML2_AUTHENTICATION_REQUEST_VALIDITY_PERIOD = "SSOService.SAML2AuthenticationRequestValidityPeriod";
public static final String SAML_SP_CERTIFICATE_EXPIRY_VALIDATION_ENABLED = "SSOService.SAMLSPCertificateExpiryValidationEnable";
public static final String SAML_IDP_INIT_LOGOUT_RESPONSE_SIGNING_ENABLED = "SSOService.SAMLIdpInitLogoutResponseSigningEnabled";
public static final String SAML_ASSERTION_ENCRYPT_WITH_APP_CERT = "SSOService.SAMLAssertionEncyptWithAppCert";
public static final String START_SOAP_BINDING = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
"<SOAP-ENV:Body>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ public SAMLSSORespDTO process(SAMLSSOAuthnReqDTO authnReqDTO, String sessionId,
spDO.setEnableSAML2ArtifactBinding(authnReqDTO.isSAML2ArtifactBindingEnabled());
spDO.setDoValidateSignatureInRequests(authnReqDTO.isDoValidateSignatureInRequests());
spDO.setDoValidateSignatureInArtifactResolve(authnReqDTO.isDoValidateSignatureInArtifactResolve());
if (SAMLSSOUtil.isSAMLIdpInitLogoutResponseSigningEnabled()) {
spDO.setDoSignResponse(authnReqDTO.isDoSignResponse());
}
sessionPersistenceManager.persistSession(sessionIndexId,
authnReqDTO.getUser().getAuthenticatedSubjectIdentifier(), spDO,
authnReqDTO.getRpSessionId(), authnReqDTO.getIssuer(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2691,4 +2691,14 @@ private static SAMLSSOServiceProviderDO getSAMLServiceProviderFromRegistry(Strin
PrivilegedCarbonContext.endTenantFlow();
}
}

/**
* Check whether SAML logout response signing is enabled for IDP initiated SSO.
* @return true if enabled.
*/
public static boolean isSAMLIdpInitLogoutResponseSigningEnabled() {

return Boolean.parseBoolean(IdentityUtil.getProperty(
SAMLSSOConstants.SAML_IDP_INIT_LOGOUT_RESPONSE_SIGNING_ENABLED));
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
<properties>
<carbon.kernel.version>4.9.10</carbon.kernel.version>
<carbon.kernel.feature.version>4.9.0</carbon.kernel.feature.version>
<carbon.identity.framework.version>5.25.258</carbon.identity.framework.version>
<carbon.identity.framework.version>5.25.260</carbon.identity.framework.version>
<carbon.identity.framework.imp.pkg.version.range>[5.25.234, 7.0.0)
</carbon.identity.framework.imp.pkg.version.range>
<carbon.identity.organization.management.core.version>1.0.0</carbon.identity.organization.management.core.version>
Expand Down

0 comments on commit 483d9d1

Please sign in to comment.