fresh-knife-52138
07/31/2025, 4:00 PM@boxyhq/saml-jackson
npm package to convert saml response into a redirect_url as done in the github/ory/polis-examples repo.
eg
// Handle the SAML Response from IdP
router.post(samlPath, async (req, res, next) => {
const { RelayState, SAMLResponse } = req.body;
try {
const { redirect_url } = await oauthController.samlResponse({ RelayState, SAMLResponse });
res.redirect(redirect_url);
} catch (err) {
next(err);
}
});
Why does the function, oauthController.samlResponse({ RelayState, SAMLResponse})
only return the redirect_url, and not the user profile? When the function does get it and use it to generate the code?
Why is it necessary to get a code, and then exchange the code for an access token, and then use the access token to get the user profile (s below) when the user profile is available before the code and even used to generate the code?
// Callback (Redirect URL)
router.get('/sso/callback', async (req, res, next) => {
const { code, state } = req.query;
// TODO: Validate state
try {
const { access_token, id_token } = await oauthController.token({
code,
client_id: `tenant=${tenant}&product=${product}`,
client_secret: 'dummy',
redirect_uri: redirectUrl,
});
// Get the profile infor using the access_token
const { id, email, firstName, lastName } = await oauthController.userInfo(access_token);
req.session.profile = { id, email, firstName, lastName };
res.redirect('/profile');
} catch (err) {
next(err);
}
});
The user profile is all that is needed but only available behind 3 unnecessary steps, that seems strange.
Is there a way to make it operate like that? To also return the profile with the redirect url?creamy-art-71586
08/01/2025, 12:34 AMfresh-knife-52138
08/01/2025, 12:53 PMcreamy-art-71586
08/01/2025, 12:58 PMcreamy-art-71586
08/01/2025, 12:59 PMfresh-knife-52138
08/01/2025, 3:10 PM<http://enterprise-sso.myapp.com|enterprise-sso.myapp.com>
such that IDPs can post to it, then that would mean the admin interface is also accessible at that url.
Is it possible to run polis with eg the api on one port and the admin interface on another? I understand you can add authentication to the admin interface. But i think it makes more sense for it to not be publicly available at all.creamy-art-71586
08/01/2025, 3:16 PMfresh-knife-52138
08/08/2025, 2:40 PMfresh-knife-52138
08/08/2025, 2:43 PMcreamy-art-71586
08/08/2025, 4:04 PMdummy
for client id and secretfresh-knife-52138
08/09/2025, 7:18 PMcreamy-art-71586
08/09/2025, 7:34 PM