octetString has to be manually build and set to request
For HTTP-Redirect requests is it required to have the octetString property in the request. However, this property does not exist on the common request object and neither is it send by Idps in HTTP-Redirect request. As a workaround I did the following:
request.octetString = this.buildOctetStringFromQuery(request.query);
private buildOctetStringFromQuery(query: AnyObject = {}): string {
return Object.keys(query)
.filter(param => param !== "Signature")
.map(param => param + "=" + encodeURIComponent(query[param]))
.join("&");
}
This approach seems to work with Keycloak as an IdP when receiving signed Logout Requests, however this seems more like a hack than a good solution.
Am I misunderstanding how the octetString is supposed to be used and if not shouldnt this be handled by the library?
Seems like this is still an issue two years later.
Based on https://github.com/tngan/samlify/blob/master/test/flow.ts#L80 (parseRedirectUrlContextCallBack), the hack proposed is the legitimate way that this API is meant to be used.
@nflaig legend! thanks for this