Cognito Federated to Salesforce and S3 Presigned URL

Login with Cognito Federated to Salesforce Example

  • see index.html
  • see ~/Dropbox/notes/ on local machine also for greater detail on setup
# local dev
# start server.  serves static files from current directory '.'.  listens on ssl 443
sudo node server.js
open https://localhost

# on s3

# on cloudfront

# copy updated file to s3
aws s3 cp index.html s3://pfeil-static-site-01/index.html
# invalidate cloudfront dist after copy

# if any login issues
# clear site data for in chrome dev tools

Pre-signed URL Example

  • see index.js
  • node index.js outputs pre-signed url. (uses ~/.aws/credentials and pre-signed URL generated under that users context/permission)
  • PUT / upload file to S3 via curl -X PUT -T hello.txt -L '<pre-signed url>'