hapi-passport-saml
hapi-passport-saml copied to clipboard
SchemeAuthenticate : Samlrequest is removed
Hi,
I have to pass the samlrequest arg in the url to the adfs entry point.
I think something is wrong in SchemeAuthenticate.js, because the search url param (which contains samlrequest) is overwrite by RelayState (line 32).
const idpLoginUrl = new URL(loginUrl.toString());
This contains the samlrequest param.
idpLoginUrl.search = 'RelayState=${request.path}';
This overwrite.
If I remove this line, samlrequest is passing.
Is there an option to preserve arguments, or remove the relaystate ?
Many thanks,
In SchemeAuthenticate.js use search param set
const idpLoginUrl = new URL(loginUrl);
idpLoginUrl.searchParams.set('RelayState', request.path);
return h.redirect(idpLoginUrl).takeover();