Example AWS Lambda function that proxies requests to an S3 bucket after first authenticating with an OIDC provider.
-
Run
npm install
to install the dependencies. -
Create a
.env
file with the following variables:
ISSUER_BASE_URL=https://your-okta-domain.okta.com
CLIENT_ID=your-oidc-app-client-id
CLIENT_SECRET=your-oidc-app-client-secret
BASE_URL=https://your-lambda-url.lambda-url.us-east-1.on.aws
SECRET=your-oidc-app-secret
S3_BUCKET=your-s3-bucket-name
REGION=us-east-1
- Deploy the lambda using
npm run deploy
. - After a few moments, set the lambda's environment variables using
npm run update-function-configuration
.
Step 4 will fail if step 2 didn't complete. You can try again after another minute or two.