How to use the oidc-provider.useRequest 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 apigee / consumer-data-standards-au / src / apiproxies / oidc-mock-provider / apiproxy / resources / hosted / app.js View on Github external
const app = express()
	// Determine whether to run in local mode
localTest = !(process.env.APIGEE_ORGANIZATION);

const oidcURL = (localTest) ? "http://localhost:9000" : process.env.OIDC_URL || ("https://" + process.env.APIGEE_ORGANIZATION + "-" + process.env.APIGEE_ENVIRONMENT + ".apigee.net");

// Add required user info claims. These are hardcoded in this function
configuration.findAccount = account.findAccount;
configuration.findById = account.findById;


const oidc = new Provider(oidcURL, configuration)

app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'ejs')
Provider.useRequest()

let server

	(async() => {
	await oidc.initialize({
		clients
	})
	app.get('/', (req, res) => res.send('Welcome to the Apigee OIDC Mock - Local version'))
	routes(app, oidc)
	app.use(oidc.callback)
	app.enable('trust proxy')
	oidc.proxy = true

	server = app.listen(process.env.PORT || 9000, function() {
		console.log('Listening on port %d', server.address().port)

oidc-provider

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

MIT
Latest version published 16 days ago

Package Health Score

79 / 100
Full package analysis