How to use the oidc-provider.createKeyStore function in oidc-provider

To help you get started, we’ve selected a few oidc-provider 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 synapsestudios / oidc-platform / api / src / bin / generate-keys.js View on Github external
const fs = require('fs');
const { createKeyStore } = require('oidc-provider');
const certificateKeystore = createKeyStore();
const integrityKeystore = createKeyStore();
const logger = require('../lib/logger');

logger.info('Generating keys. This will take a few seconds...');
Promise.all([
  certificateKeystore.generate('RSA', 2048, {
    kid: 'sig-rs-0',
    use: 'sig',
  }),
  certificateKeystore.generate('RSA', 2048, {
    kid: 'enc-rs-0',
    use: 'enc',
  }),
  certificateKeystore.generate('EC', 'P-256', {
    kid: 'sig-ec2-0',
    use: 'sig',
  }),
github AKIRA-MIYAKE / serverless-oidc-provider / src / app / oidc / keystore / generate-keys.js View on Github external
const generateKeys = () => {
  const keystore = createKeyStore()

  return Promise.all([['RSA', 2048], ['EC', 'P-256'], ['EC', 'P-384'], ['EC', 'P-521']]
    .map(([v0, v1]) => keystore.generate(v0, v1)))
    .then(() => promisify(fs.writeFile)(
      path.resolve(__dirname, './keystore.json'),
      JSON.stringify(keystore.toJSON(true), null, 2)
    ))
}
github woleet / woleet.id-server / server / src / controllers / oidc-provider.ts View on Github external
const keystorePromise = (async () => {
  const keystore = OIDCProvider.createKeyStore();

  await Promise.all([
    keystore.generate('RSA', 2048, { alg: 'RS256', use: 'sig' }),
    keystore.generate('EC', 'P-256', { kid: 'enc-ec2-0', use: 'sig' })
  ]);

  return keystore;
})();
github openintegrationhub / openintegrationhub / services / iam / src / oidc / util / generate-keystore.js View on Github external
const Logger = require('@basaas/node-logger');
const fs = require('fs');
const path = require('path');
const { createKeyStore } = require('oidc-provider');
const conf = require('../../conf');

const keystore = createKeyStore();

const log = Logger.getLogger(`${conf.general.loggingNameSpace}/keystore`, {
    level: 'debug',
});

const keyStorePath = conf.oidc.keystorePath || path.join(__dirname, '../../../', 'keystore/keystore.json');

const generate = async (keySize) => {

    try {

        await Promise.all([
            keystore.generate('RSA', keySize, {
                kid: 'sig-rs-0',
                use: 'sig',
            }),
github synapsestudios / oidc-platform / api / src / bin / generate-keys.js View on Github external
const fs = require('fs');
const { createKeyStore } = require('oidc-provider');
const certificateKeystore = createKeyStore();
const integrityKeystore = createKeyStore();
const logger = require('../lib/logger');

logger.info('Generating keys. This will take a few seconds...');
Promise.all([
  certificateKeystore.generate('RSA', 2048, {
    kid: 'sig-rs-0',
    use: 'sig',
  }),
  certificateKeystore.generate('RSA', 2048, {
    kid: 'enc-rs-0',
    use: 'enc',
  }),
  certificateKeystore.generate('EC', 'P-256', {
    kid: 'sig-ec2-0',
    use: 'sig',

oidc-provider

OAuth 2.0 Authorization Server implementation for Node.js with OpenID Connect

MIT
Latest version published 20 hours ago

Package Health Score

82 / 100
Full package analysis