almamedia / il-auth-at-edge Goto Github PK
View Code? Open in Web Editor NEWModified AWS sample enabling Cognito authentication @ cloudfront edge. Install on any account and link to cloudfront dostribution as needed.
License: Apache License 2.0
Modified AWS sample enabling Cognito authentication @ cloudfront edge. Install on any account and link to cloudfront dostribution as needed.
License: Apache License 2.0
Instead (or in addition to) of S3-distributed html page, provide a Lambda function that can be attached to Cloudfront (or later, ALB)
The Lambda function should:
Changes to existing auth lambda function:
Cookie parsing in Lambda is ugly, use some library
The last cloudformation template fails with the following error:
UserPoolAndClient CREATE_FAILED Custom Resource failed to stabilize in expected time
Here is the log:
il-auth-at-edge
20 May 2019 14:26:06 CognitoUserPool CREATE_FAILED Embedded stack arn:aws:cloudformation:us-east-1:AWS_ACCOUNTID:stack/il-auth-at-edge-CognitoUserPool-14B6JQSBZT49N/56e94530-7b02-11e9-8f85-0a33c80c982c was not successfully created: The following resource(s) failed to create: [UserPoolAndClient].
il-auth-at-edge-CognitoUserPool-14B6JQSBZT49N
20 May 2019 14:23:31 il-auth-at-edge-CognitoUserPool-14B6JQSBZT49N CREATE_FAILED The following resource(s) failed to create: [UserPoolAndClient].
20 May 2019 14:23:27 UserPoolAndClient CREATE_FAILED Custom Resource failed to stabilize in expected time
Include a file containing texts for Cognito's emails and SMSs (account verification etc.) in lambda deploy package and read them tehre when creating / updating userpool.
Capture also refresh token in token capture page and store it clientside (localstorage?).
Check access token expiration in auth lambda, redirect to a new page that refreshes tokens an sets new cookies & local storage.
Cognito's keys and client id are hardcoded to auth lambda deployment package by extracting the package, modifying the source code and repackaging, which is hideous.
Make Lambda fetch these on startup using AWS SDK. Make sure it has suitable policy to do this.
Application's Cloudformation stacks rely heavily on lambda-backed custom resources. These should be fixed to be properly updatable so that:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.