How to use samlify - 7 common examples

To help you get started, we’ve selected a few samlify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github authenio / react-samlify / middleware / index.ts View on Github external
// configure okta idp
const oktaIdp = samlify.IdentityProvider({
  metadata: fs.readFileSync(__dirname + '/../metadata/okta.xml'),
  wantLogoutRequestSigned: true
});

const oktaIdpEnc = samlify.IdentityProvider({
  metadata: fs.readFileSync(__dirname + '/../metadata/okta-enc.xml'),
  isAssertionEncrypted: true,
  messageSigningOrder: 'encrypt-then-sign',
  wantLogoutRequestSigned: true,
});

// configure our service provider (your application)
const sp = samlify.ServiceProvider({
  entityID: 'http://localhost:8080/metadata',
  authnRequestsSigned: false,
  wantAssertionsSigned: true,
  wantMessageSigned: true,
  wantLogoutResponseSigned: true,
  wantLogoutRequestSigned: true,
  privateKey: fs.readFileSync(__dirname + '/../key/sign/privkey.pem'),
  privateKeyPass: 'VHOSp5RUiBcrsjrcAuXFwU1NKCkGA8px',
  isAssertionEncrypted: false,
  assertionConsumerService: [{
    Binding: binding.post,
    Location: 'http://localhost:8080/sp/acs',
  }]
});

// encrypted response
github authenio / samlify-sp / server.js View on Github external
server.post('/sp/edit', (req, res) => {
    // re-create a new service provider
    dynamicServiceProvider = new samlify.ServiceProvider(req.body.config);
    res.json({ success: true });
  });
github authenio / react-samlify / middleware / index.ts View on Github external
authnRequestsSigned: false,
  wantAssertionsSigned: true,
  wantMessageSigned: true,
  wantLogoutResponseSigned: true,
  wantLogoutRequestSigned: true,
  privateKey: fs.readFileSync(__dirname + '/../key/sign/privkey.pem'),
  privateKeyPass: 'VHOSp5RUiBcrsjrcAuXFwU1NKCkGA8px',
  isAssertionEncrypted: false,
  assertionConsumerService: [{
    Binding: binding.post,
    Location: 'http://localhost:8080/sp/acs',
  }]
});

// encrypted response
const spEnc = samlify.ServiceProvider({
  entityID: 'http://localhost:8080/metadata?encrypted=true',
  authnRequestsSigned: false,
  wantAssertionsSigned: true,
  wantMessageSigned: true,
  wantLogoutResponseSigned: true,
  wantLogoutRequestSigned: true,
  privateKey: fs.readFileSync(__dirname + '/../key/sign/privkey.pem'),
  privateKeyPass: 'VHOSp5RUiBcrsjrcAuXFwU1NKCkGA8px',
  encPrivateKey: fs.readFileSync(__dirname + '/../key/encrypt/privkey.pem'),
  assertionConsumerService: [{
    Binding: binding.post,
    Location: 'http://localhost:8080/sp/acs?encrypted=true',
  }]
});

export const assignEntity = (req, res, next) => {
github authenio / react-samlify / middleware / index.ts View on Github external
import * as samlify from 'samlify';
import * as fs from 'fs';
import * as validator from '@authenio/samlify-node-xmllint';

const binding = samlify.Constants.namespace.binding;

samlify.setSchemaValidator(validator);

// configure okta idp
const oktaIdp = samlify.IdentityProvider({
  metadata: fs.readFileSync(__dirname + '/../metadata/okta.xml'),
  wantLogoutRequestSigned: true
});

const oktaIdpEnc = samlify.IdentityProvider({
  metadata: fs.readFileSync(__dirname + '/../metadata/okta-enc.xml'),
  isAssertionEncrypted: true,
  messageSigningOrder: 'encrypt-then-sign',
  wantLogoutRequestSigned: true,
});

// configure our service provider (your application)
const sp = samlify.ServiceProvider({
  entityID: 'http://localhost:8080/metadata',
  authnRequestsSigned: false,
  wantAssertionsSigned: true,
  wantMessageSigned: true,
  wantLogoutResponseSigned: true,
  wantLogoutRequestSigned: true,
  privateKey: fs.readFileSync(__dirname + '/../key/sign/privkey.pem'),
  privateKeyPass: 'VHOSp5RUiBcrsjrcAuXFwU1NKCkGA8px',
github authenio / react-samlify / middleware / index.ts View on Github external
import * as samlify from 'samlify';
import * as fs from 'fs';
import * as validator from '@authenio/samlify-node-xmllint';

const binding = samlify.Constants.namespace.binding;

samlify.setSchemaValidator(validator);

// configure okta idp
const oktaIdp = samlify.IdentityProvider({
  metadata: fs.readFileSync(__dirname + '/../metadata/okta.xml'),
  wantLogoutRequestSigned: true
});

const oktaIdpEnc = samlify.IdentityProvider({
  metadata: fs.readFileSync(__dirname + '/../metadata/okta-enc.xml'),
  isAssertionEncrypted: true,
  messageSigningOrder: 'encrypt-then-sign',
  wantLogoutRequestSigned: true,
});

// configure our service provider (your application)
const sp = samlify.ServiceProvider({
  entityID: 'http://localhost:8080/metadata',
  authnRequestsSigned: false,
  wantAssertionsSigned: true,
github authenio / react-samlify / middleware / index.ts View on Github external
import * as samlify from 'samlify';
import * as fs from 'fs';
import * as validator from '@authenio/samlify-node-xmllint';

const binding = samlify.Constants.namespace.binding;

samlify.setSchemaValidator(validator);

// configure okta idp
const oktaIdp = samlify.IdentityProvider({
  metadata: fs.readFileSync(__dirname + '/../metadata/okta.xml'),
  wantLogoutRequestSigned: true
});

const oktaIdpEnc = samlify.IdentityProvider({
  metadata: fs.readFileSync(__dirname + '/../metadata/okta-enc.xml'),
  isAssertionEncrypted: true,
  messageSigningOrder: 'encrypt-then-sign',
  wantLogoutRequestSigned: true,
});
github authenio / react-samlify / middleware / index.ts View on Github external
import * as samlify from 'samlify';
import * as fs from 'fs';
import * as validator from '@authenio/samlify-node-xmllint';

const binding = samlify.Constants.namespace.binding;

samlify.setSchemaValidator(validator);

// configure okta idp
const oktaIdp = samlify.IdentityProvider({
  metadata: fs.readFileSync(__dirname + '/../metadata/okta.xml'),
  wantLogoutRequestSigned: true
});

const oktaIdpEnc = samlify.IdentityProvider({
  metadata: fs.readFileSync(__dirname + '/../metadata/okta-enc.xml'),
  isAssertionEncrypted: true,
  messageSigningOrder: 'encrypt-then-sign',
  wantLogoutRequestSigned: true,
});

// configure our service provider (your application)
const sp = samlify.ServiceProvider({

samlify

High-level API for Single Sign On (SAML 2.0)

MIT
Latest version published 2 months ago

Package Health Score

78 / 100
Full package analysis