Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Sample Lambda code, CloudFormation, SAM templates and Client website for performing SAML auth flows for AWS access in user applications

License

Notifications You must be signed in to change notification settings

amazon-archives/samljs-serverless-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAML JavaScript Serverless Sample App

This repository contains sample code and SAM templates for performing SAML AuthN/AuthZ flows to access AWS services from a user-facing application. The sample applications are written in JavaScript with minimal UI or extras in order to act as a tutorial for getting credentials and calling API Gateway endpoints protected by AWS_IAM. This can be extended for use against other AWS Service through IAM roles and other client application such as Native apps.

Detailed readme files are in each sub directory. A walk through tutorial is in a 2-part blog series located here.

Scenario 1

This is the "client-side" flow where SAML assertions are returned to the client via API Gateway. JavaScript in the browser passes the assertion to Amazon Cognito Identity and recieves AWS credentials back for signing requests to access other AWS Services.

lambdasamlone_4.png

Scenario 2

This is the "backend" flow where a custom AWS Lambda function will use an XML parser to find out what Active Directory group the user belongs to and make an appropriate call for credentials on behalf of the user. It then shows how to generate and sign JWT tokens with KMS and use API Gateway custom authorizers so the client application can retrieve credentials to use with different AWS Services.

lambdasamltwo_1.png

About

Sample Lambda code, CloudFormation, SAM templates and Client website for performing SAML auth flows for AWS access in user applications

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published