import * as dotenv from 'dotenv';
import * as fs from 'fs';
import * as path from 'path';

dotenv.config();

const certPath = path.resolve(
  process.cwd(),
  process.env.SAML_PRIVATE_CERT_PATH,
);
export default {
  saml: {
    strategyOptions: {
      entryPoint: process.env.SAML_ENTRY_POINT,
      issuer: process.env.SAML_ISSUER,
      callbackUrl: process.env.SAML_CALLBACK_URL,
      privateCert: fs.readFileSync(certPath, 'utf-8'),
      cert: fs.readFileSync(certPath, 'utf-8'),
      signatureAlgorithm: 'sha256',
      authContext:
        'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport',
    },
  },
};
