Skip to content

Commit

Permalink
find IdP issuer from saml request also (saml federation login-logout)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgeorgilakis committed Sep 13, 2023
1 parent c439eaf commit 009d815
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<jboss.snapshots.repo.url>https://s01.oss.sonatype.org/content/repositories/snapshots/</jboss.snapshots.repo.url>

<quarkus.version>2.7.5.Final</quarkus.version>
<eosc-kc.version>${project.version}-2.17rc1</eosc-kc.version>
<eosc-kc.version>${project.version}-2.17rc2</eosc-kc.version>

<!--
Performing a Wildfly upgrade? Run the:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,9 @@ public Object getEndpoint(@PathParam("provider_id") String providerId) {
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Path(ENDPOINT_PATH)
public Response getIdpFederationEndpointPOST(@FormParam(GeneralConstants.SAML_REQUEST_KEY) String samlRequest, @FormParam(GeneralConstants.SAML_RESPONSE_KEY) String samlResponse, @FormParam(GeneralConstants.RELAY_STATE) String relayState) {
if (samlResponse == null)
if (samlResponse == null && samlRequest == null)
return errorForNullSamlResponse();
byte[] samlBytes = PostBindingUtil.base64Decode(samlResponse);
byte[] samlBytes = PostBindingUtil.base64Decode(samlRequest != null ? samlRequest : samlResponse);
SAMLDocumentHolder samlDocumentHolder = SAMLRequestParser.parseResponseDocument(samlBytes);
StatusResponseType statusResponse = (StatusResponseType) samlDocumentHolder.getSamlObject();
String issuer = statusResponse.getIssuer().getValue(); //this should be the entityId
Expand All @@ -474,9 +474,9 @@ public Response getIdpFederationEndpointPOST(@FormParam(GeneralConstants.SAML_RE
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Path(ENDPOINT_PATH)
public Response getIdpFederationEndpointGET(@QueryParam(GeneralConstants.SAML_REQUEST_KEY) String samlRequest, @QueryParam(GeneralConstants.SAML_RESPONSE_KEY) String samlResponse, @QueryParam(GeneralConstants.RELAY_STATE) String relayState) {
if (samlResponse == null)
if (samlResponse == null && samlRequest == null)
return errorForNullSamlResponse();
SAMLDocumentHolder samlDocumentHolder = SAMLRequestParser.parseResponseRedirectBinding(samlResponse);
SAMLDocumentHolder samlDocumentHolder = SAMLRequestParser.parseResponseRedirectBinding(samlRequest != null ? samlRequest : samlResponse);
StatusResponseType statusResponse = (StatusResponseType)samlDocumentHolder.getSamlObject();
String issuer = statusResponse.getIssuer().getValue(); //this should be the entityId
String alias = SAMLFederationProvider.getHash(issuer);
Expand Down

0 comments on commit 009d815

Please sign in to comment.