lambda-oidc-authenticator
Version:
An AWS Lambda function to provide an oidc Custom Authenticator for AWS API Gateway ( tested with key-cloak). Inspired from lambda-auth0-authorizer
16 lines (13 loc) • 425 B
JavaScript
var lib = require('./lib');
var fs = require('fs');
// Lambda function index.handler - thin wrapper around lib.authenticate
module.exports.handler = function( event, context ) {
lib.authenticate( event )
.then( context.succeed )
.catch( err => {
if ( ! err ) context.fail( "Unhandled error case" );
// if ( err.message ) context.fail( err.message );
context.fail( err );
});
};
;