Page 1 of 1

How to code SAML 2.0 in PureBasic?

Posted: Tue Jul 17, 2018 9:26 am
by stmdbe2019
How to write this code in PureBasic? example: https://samlify.js.org/#/

Code: Select all

const saml = require('samlify');
// configure a service provider
const sp = saml.ServiceProvider({
  metadata: fs.readFileSync('./metadata_sp.xml')
});
// configure the corresponding identity provider
const idp = saml.IdentityProvider({
  metadata: fs.readFileSync('./metadata_idp.xml')
});
// parse when receive a SAML Response from IdP
router.post('/acs', (req, res) => {
  sp.parseLoginResponse(idp, 'post', req)
  .then(parseResult => {
    // Write your own validation and render function here
  })
  .catch(console.error);
});