Provide the authentication callback route
masterYou must define a POST route that matches the callbackURL (or callbackUrl) configured in your strategy. This route must be placed after your body-parsing middleware.
Express v4.x: Use body-parser.
Express v5.x: Use express.urlencoded.
// Express v4 example
const bodyParser = require("body-parser");
app.post(
"/login/callback",
bodyParser.urlencoded({ extended: false }),
passport.authenticate("saml", {
failureRedirect: "/",
failureFlash: true,
}),
function (req, res) {
res.redirect("/");
},
);