I am unable to retrieve the RelayState value. Can someone please direct me or provide a link to relevant documentation.
This is what I have so far as my setup and routes.
Setup
const saml_strategy = new saml.Strategy(
{
'callbackUrl': 'https://callback-url/adfs/postResponse',
'entryPoint': 'https://entry-url/adfs/ls/',
'issuer': 'issuer-name',
'decryptionPvk': fs.readFileSync('./private.key', 'utf-8'),
'cert': [idp_cert],
'identifierFormat': null,
'disableRequestedAuthnContext': true,
'authnContext': ["urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"],
'additionalParams':{'RelayState':'test'}
},
Routes
app.get(
'/',
function (req, res) {
if (req.isAuthenticated())
{
res.send( '{ "authenticated": true }' );
}
else
{
res.send( '{ "authenticated": false }' );
}
}
);
app.get(
'/login',
passport.authenticate('saml', { 'successRedirect': '/', 'failureRedirect': '/login' }),
function(req, res)
{
res.redirect('/');
}
);
///login/callback
app.post(
'/adfs/postResponse',
passport.authenticate('saml', { 'failureRedirect': '/', 'failureFlash': true }),
function(req, res)
{
res.redirect('/');
}
);