Send the SAMLRequest as a query param. #753
-
Hi 👋, @Injectable()
export class SamlStrategy extends PassportStrategy(MultiSamlStrategy, 'saml') {
constructor(private readonly authSamlSettingService: AuthSamlSettingService) {
super(
{
passReqToCallback: true,
getSamlOptions: async (request: Request, callback: SamlOptionsCallback) => {
const userId = userId;
const authSamlSetting = await authSamlSettingService.findOne(userId);
return callback(null, {
entryPoint: authSamlSetting.entrypoint,
issuer: authSamlSetting.issuer,
cert: authSamlSetting.certificate,
authnRequestBinding: 'HTTP-POST',
});
},
},
(request: Request, profile: Profile, done: VerifiedCallback) => {
done(null, profile);
},
);
}
} This works fine with IdPs like Okta and OneLogin where my Nestjs app redirects the user to the IdP, but when testing with Azure AD, the authentication fails because azure expects a SAMLRequest as a query param when redirecting from my app. I was wondering if this is something already taken care of by passport-saml, because the closest thing I can come up with is manually adding the base64 encoded request using Thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
We have code that does that already and the setups I've worked with have no problem doing this out of the box. |
Beta Was this translation helpful? Give feedback.
We have code that does that already and the setups I've worked with have no problem doing this out of the box.