SlideShare a Scribd company logo
1 of 41
Download to read offline
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Vladimir Budilov, Technical Account Manager
6/21/2016
Workshop: How to Architect User
Authentication and Authorization in Your
Apps
What to expect from this session?
• High-level overview of AWS Mobile Services
• Deep dive into Amazon Cognito, specifically Cognito
User Pools
• Walkthrough of a ready-to-use Angular 2 app powered by
Cognito
• How to store & manage users without creating a line of
server-side code (no plumbing needed!)
The QuickStart App
Demo time!
http://cognito.budilov.com
AWS Mobile SDKs
Authenticate users
Analyze User Behavior
Store and share media
Synchronize data
Deliver media
Amazon Cognito
(Sync)
Amazon Cognito
(Identity)
Amazon S3
Amazon CloudFront
Store data
Amazon DynamoDB
Track Retention
Amazon Mobile
Analytics
Send push notifications
Amazon SNS
Mobile Push
Server-side logic
Lambda
Device Farm
Test your app
Build and Scale Your Apps on AWS
Amazon Mobile
Analytics
What is Amazon DynamoDB?
• Managed NoSQL database service
• Consistent, low latency performance
(single digit ms) at any scale
• Predictable provisioned throughput
• High durability and availability (3x
replication)
DynamoDB
What is Amazon S3?
• Cloud storage
• Static website hosting
• 11 9’s of Durability
• 4 9’s of Availability
• CloudFront Integration
Undifferentiated Heavy Lifting of Authentication
• Create and secure a database
• Create the UI
• Create the server-side code
• Create the IdP access token verification logic
• Consolidate IdP credentials
• Generate and manage a custom secure token
• Manage the token lifespan
• Manage the user lifecycle
Amazon Cognito
Manage authenticated
and guest users’
access to your AWS
resources
Federated Identities
Synchronize user’s data
across devices and
platforms via the cloud
Data Synchronization
Add sign-up and sign-
in with a fully
managed user
directory
Your User Pool
GuestYour own auth
Amazon Cognito Identity Amazon Cognito Sync
k/v data
What’s Amazon Cognito?
Amazon Cognito Federated Identities
• Authenticate Users with third-party IdPs
• Authenticate with Cognito User Pool
• Anonymous Identities
• Federation of Identities
• OpenID Connect Token Generation
• Control access from your app to other AWS Services
Amazon Cognito Sync
• Store Customer Data in the Cloud
• Synchronize Data
• Cognito Events Trigger AWS Lambda Functions
• Cognito Streams Send Data to Amazon Kinesis
Amazon Cognito User Pools
Add sign-up and sign-in
easily to your mobile and
web apps
Easy User Management
Verify phone numbers and
email addresses and offer
multi-factor authentication
Enhanced Security Features
Launch a simple, secure,
low-cost, and fully managed
service to create and
maintain a user directory
that scales to 100s of
millions of users
Managed User Directory
Comprehensive User Scenarios
Email or phone number
Verification
Forgot Password
User sign-up and sign-
in
Users verify their email address or phone number prior to activating an account
Users can change their password if they forget it
Users sign-up using email, phone number or user name and password.
Users can then sign-in.
User Profile Retrieve and update user profiles, including custom attributes
SMS-based MFA
If enabled, users complete Multi-Factor Authentication (MFA) with a confirmation
code via SMS as part of sign-in and forgot password flows
Customization using Lambda hooks
Lambda Hook Example Scenarios
Pre user sign-up
Custom validation to accept or deny the
sign-up request
Custom message
Advanced customization and localization of
verification messages
Pre user sign-in
Custom validation to accept or deny the
sign-in request
Post user sign-in Event logging for custom analytics
Post user confirmation
Custom welcome messages or event
logging for custom analytics
Comprehensive Administrator Scenarios
Manage users in a
User Pool
Select Email and
Phone Verification
Customize with Lambda
Triggers
Setup Password
Policies
Create and manage
User Pools
List, search and perform actions on specific user(s) in the User Pool
Configure verifications of users’ email addresses and phone numbers (via SMS)
Create functions in AWS Lambda to customize workflows
Control password requirements like minimum length, uppercase, and inclusion of
special characters
Create, configure and delete multiple User Pools in their AWS account
Define Attributes Select required attributes and Define custom user attributes
Secure Sign-in Made Easy
Token-based
Authentication
Secure Remote
Password Protocol
SMS-based Multi-factor
Authentication
Uses tokens based on OpenID Connect (OIDC) and OAuth 2.0 standards
Uses Secure Remote Password (SRP) for secure password handling end to end
Enables your end users to use the text messaging functionality of a mobile
phone as an extra layer of security
Authentication flow
Code Time!
Authentication Flow
Amazon Cognito
User Pools
Amazon
DynamoDB
Mobile apps
Lets walk through
this step by step…S3
Lambda Hooks
Amazon Cognito
Identities
Authentication Flow
Amazon Cognito
User Pools
Amazon
DynamoDB
Mobile apps
Step 0: User invokes the website hosted
on S3
Amazon S3 can be used as a highly
available website hosting platform
Lambda Hooks
Amazon Cognito
Identities
S3
Authentication Flow
Amazon Cognito
User Pools
Mobile apps
Step 1: User signs up for an account with
our Amazon Cognito User Pool, providing
their email & password (+ any custom
attributes).
Amazon Cognito can automatically verify
the user’s email address and/or phone
number if required.
S3
Amazon
DynamoDB
Lambda Hooks
Amazon Cognito
Identities
Authentication Flow
Amazon Cognito
User Pools
Mobile apps
Step 2: At some point in the
future, the user wants to sign in.
We can now authenticate the
user.
Amazon
DynamoDB
Lambda Hooks
Amazon Cognito
Identities
S3
Authentication Flow
Amazon Cognito
User Pools
Mobile apps
Optional: If MFA is enabled
(either for this user, or all users),
Amazon Cognito will SMS a one
time authentication code to the
user.
Amazon
DynamoDB
Lambda Hooks
Amazon Cognito
Identities
S3
Authentication Flow
Amazon Cognito
User Pools
Mobile apps
Optional: If Lambda Hooks are
setup, then they will be invoked
Amazon
DynamoDB
Lambda Hooks
S3
Amazon Cognito
Identities
Authentication Flow
Amazon Cognito
User Pools
Mobile apps
Step 3: After a successful
authentication, Amazon Cognito
responds with a signed JSON
Web Token (JWT) containing the
user’s details.
Amazon
DynamoDB
Lambda Hooks
S3
Amazon Cognito
Identities
Authentication Flow
Amazon Cognito
User Pools
Mobile apps
Step 4: Once you’re
authenticated, you want to
retrieve your scoped AWS
credentials to access other
services.
Amazon
DynamoDB
Lambda Hooks
S3
Amazon Cognito
Identities
Authentication Flow
Amazon Cognito
User Pools
Mobile apps
Step 5: You are now ready to
call DynamoDB.
Amazon
DynamoDB
Lambda Hooks
S3
Amazon Cognito
Identities
Going serverless
Amazon Cognito
User Pools
Amazon API Gateway
Lambda Hooks
/v1 Lambda Function
/v2… Lambda
Function
Amazon
DynamoDB
Throttling
Cache
Logging
Monitoring
Auth
Mobile apps
This is a more
complete solution
that you can achieve
without managing
servers…
S3
Amazon Cognito
Identities
Getting started with the
QuickStart app
Tech Stack
• Required Tools
• aws cli
• npm
• bower
• angular-cli
• Frameworks
• AWS JavaScript SDK & Amazon Cognito Libraries
• Angular 2 (Ionic) RC2
• TypeScript
• Bootstrap
Get The QuickStart App
# Clone it from github
git clone --depth 1 git@github.com:awslabs/aws-cognito-angular2-quickstart.git
# Install the NPM and Bower packages
npm install
bower install
# Run the app in dev mode
npm start
# Build the project and sync the output with the S3 bucket
ng build
cd dist
aws s3 sync . s3://your-unique-bucket-name/
# Test it out
curl –I http://your-unique-bucket-name.s3-website-us-east-1.amazonaws.com/
Code Time!
Tokens
Types
• ID Token
• JWT
• OpenID Identity Information (name, phone_number, etc)
• Access Token
• JWT
• No Identity Information
• Used for further authorizations
• Refresh Token
• String
• Refresh Amazon Cognito Identity session
ID Token
• Header
• kid – used to locate the public key
• alg – RS256
• Payload
• user attributes (user identity information)
• iss – the issuer
• sub – UUID of the authenticated user
• token_use – the purpose of the token
• Signature
• Based on header and payload
Access Token
• Header
• kid – different from ID token since different keys used
• alg – RS256
• Payload
• username – (e.g. vladimir@budilov.com)
• Signature
• Based on header and payload
Unpacking a Token
Thank You!
Questions? Comments? Suggestions?
Don’t Forget Evaluations!

More Related Content

What's hot

Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewaySteve Androulakis
 
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...Amazon Web Services
 
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...Amazon Web Services
 
Serverless Authentication and Authorisation
Serverless Authentication and AuthorisationServerless Authentication and Authorisation
Serverless Authentication and AuthorisationAmazon Web Services
 
Deep Dive on Amazon Cognito - DevDay Los Angeles 2017
Deep Dive on Amazon Cognito - DevDay Los Angeles 2017Deep Dive on Amazon Cognito - DevDay Los Angeles 2017
Deep Dive on Amazon Cognito - DevDay Los Angeles 2017Amazon Web Services
 
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)Amazon Web Services
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayBuild a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayDanilo Poccia
 
AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018Yoel Spotts
 
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech Talks
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech TalksDeep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech Talks
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech TalksAmazon Web Services
 
Managing Identity and Securing Your Mobile and Web Applications with Amazon C...
Managing Identity and Securing Your Mobile and Web Applications with Amazon C...Managing Identity and Securing Your Mobile and Web Applications with Amazon C...
Managing Identity and Securing Your Mobile and Web Applications with Amazon C...Amazon Web Services
 
Amazon Cognito Public Beta of Built-in UI for User Sign-up/in and SAML Federa...
Amazon Cognito Public Beta of Built-in UI for User Sign-up/in and SAML Federa...Amazon Cognito Public Beta of Built-in UI for User Sign-up/in and SAML Federa...
Amazon Cognito Public Beta of Built-in UI for User Sign-up/in and SAML Federa...Amazon Web Services
 
Mobile Application Development and Testing on AWS
Mobile Application Development and Testing on AWSMobile Application Development and Testing on AWS
Mobile Application Development and Testing on AWSAmazon Web Services
 
Cloud Security-how to create serverless applications
Cloud Security-how to create serverless applicationsCloud Security-how to create serverless applications
Cloud Security-how to create serverless applicationsAmazon Web Services
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gatewayaws-marketing-il
 
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...Amazon Web Services
 
Deep Dive on Amazon Cognito - DevDay Austin 2017
Deep Dive on Amazon Cognito - DevDay Austin 2017Deep Dive on Amazon Cognito - DevDay Austin 2017
Deep Dive on Amazon Cognito - DevDay Austin 2017Amazon Web Services
 
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...Amazon Web Services
 
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...Amazon Web Services
 
Simple Security for Startups
Simple Security for StartupsSimple Security for Startups
Simple Security for StartupsMark Bate
 

What's hot (20)

Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
 
Amazon Cognito
Amazon CognitoAmazon Cognito
Amazon Cognito
 
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...
 
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...
Mobile Applications and The Internet of Things: AWS Lambda & AWS Cognito – Ad...
 
Serverless Authentication and Authorisation
Serverless Authentication and AuthorisationServerless Authentication and Authorisation
Serverless Authentication and Authorisation
 
Deep Dive on Amazon Cognito - DevDay Los Angeles 2017
Deep Dive on Amazon Cognito - DevDay Los Angeles 2017Deep Dive on Amazon Cognito - DevDay Los Angeles 2017
Deep Dive on Amazon Cognito - DevDay Los Angeles 2017
 
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayBuild a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
 
AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018
 
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech Talks
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech TalksDeep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech Talks
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech Talks
 
Managing Identity and Securing Your Mobile and Web Applications with Amazon C...
Managing Identity and Securing Your Mobile and Web Applications with Amazon C...Managing Identity and Securing Your Mobile and Web Applications with Amazon C...
Managing Identity and Securing Your Mobile and Web Applications with Amazon C...
 
Amazon Cognito Public Beta of Built-in UI for User Sign-up/in and SAML Federa...
Amazon Cognito Public Beta of Built-in UI for User Sign-up/in and SAML Federa...Amazon Cognito Public Beta of Built-in UI for User Sign-up/in and SAML Federa...
Amazon Cognito Public Beta of Built-in UI for User Sign-up/in and SAML Federa...
 
Mobile Application Development and Testing on AWS
Mobile Application Development and Testing on AWSMobile Application Development and Testing on AWS
Mobile Application Development and Testing on AWS
 
Cloud Security-how to create serverless applications
Cloud Security-how to create serverless applicationsCloud Security-how to create serverless applications
Cloud Security-how to create serverless applications
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gateway
 
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
AWS July Webinar Series - Overview Build and Manage your APs with amazon api ...
 
Deep Dive on Amazon Cognito - DevDay Austin 2017
Deep Dive on Amazon Cognito - DevDay Austin 2017Deep Dive on Amazon Cognito - DevDay Austin 2017
Deep Dive on Amazon Cognito - DevDay Austin 2017
 
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
 
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...
 
Simple Security for Startups
Simple Security for StartupsSimple Security for Startups
Simple Security for Startups
 

Viewers also liked

Connect2016 Shipping Domino
Connect2016 Shipping DominoConnect2016 Shipping Domino
Connect2016 Shipping DominoFactor-y S.r.l.
 
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...Amazon Web Services
 
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...Mitoc Group
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayAmazon Web Services
 
Build Web Applications using Microservices on Node.js and Serverless AWS
Build Web Applications using Microservices on Node.js and Serverless AWSBuild Web Applications using Microservices on Node.js and Serverless AWS
Build Web Applications using Microservices on Node.js and Serverless AWSMitoc Group
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript Corley S.r.l.
 
Connect2016 - 1172 Shipping domino
Connect2016 - 1172 Shipping dominoConnect2016 - 1172 Shipping domino
Connect2016 - 1172 Shipping dominoMatteo Bisi
 
確定申告 Androidアプリ
確定申告 Androidアプリ確定申告 Androidアプリ
確定申告 Androidアプリfreee株式会社
 
Slide kinh nghiệm vận hành Cloud trên Amazon - Huỳnh Kỳ Anh
Slide kinh nghiệm vận hành Cloud trên Amazon - Huỳnh Kỳ AnhSlide kinh nghiệm vận hành Cloud trên Amazon - Huỳnh Kỳ Anh
Slide kinh nghiệm vận hành Cloud trên Amazon - Huỳnh Kỳ AnhLuong Trung Thanh
 
FintechとID・サービス連携のエコシステム - OpenID Summit 2015
FintechとID・サービス連携のエコシステム - OpenID Summit 2015FintechとID・サービス連携のエコシステム - OpenID Summit 2015
FintechとID・サービス連携のエコシステム - OpenID Summit 2015OpenID Foundation Japan
 
Trust Frameworkと法人番号について - OpenID Summit 2015
Trust Frameworkと法人番号について - OpenID Summit 2015Trust Frameworkと法人番号について - OpenID Summit 2015
Trust Frameworkと法人番号について - OpenID Summit 2015OpenID Foundation Japan
 
King Tut Stella 6A
King Tut Stella 6AKing Tut Stella 6A
King Tut Stella 6AMr. Hurst
 
(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...
(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...
(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...Amazon Web Services
 
SEC302 Delegating Access to Your AWS Environment - AWS re: Invent 2012
SEC302 Delegating Access to Your AWS Environment - AWS re: Invent 2012SEC302 Delegating Access to Your AWS Environment - AWS re: Invent 2012
SEC302 Delegating Access to Your AWS Environment - AWS re: Invent 2012Amazon Web Services
 
(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014
(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014
(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014Amazon Web Services
 
[会計freee] 2.スタートガイド
[会計freee] 2.スタートガイド[会計freee] 2.スタートガイド
[会計freee] 2.スタートガイドfreee株式会社
 
AWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated BillingAWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated BillingAmazon Web Services
 

Viewers also liked (20)

Connect2016 Shipping Domino
Connect2016 Shipping DominoConnect2016 Shipping Domino
Connect2016 Shipping Domino
 
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
 
Amazon Cognito
Amazon CognitoAmazon Cognito
Amazon Cognito
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API Gateway
 
Build Web Applications using Microservices on Node.js and Serverless AWS
Build Web Applications using Microservices on Node.js and Serverless AWSBuild Web Applications using Microservices on Node.js and Serverless AWS
Build Web Applications using Microservices on Node.js and Serverless AWS
 
The advantage of developing with TypeScript
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
 
Connect2016 - 1172 Shipping domino
Connect2016 - 1172 Shipping dominoConnect2016 - 1172 Shipping domino
Connect2016 - 1172 Shipping domino
 
確定申告 Androidアプリ
確定申告 Androidアプリ確定申告 Androidアプリ
確定申告 Androidアプリ
 
Slide kinh nghiệm vận hành Cloud trên Amazon - Huỳnh Kỳ Anh
Slide kinh nghiệm vận hành Cloud trên Amazon - Huỳnh Kỳ AnhSlide kinh nghiệm vận hành Cloud trên Amazon - Huỳnh Kỳ Anh
Slide kinh nghiệm vận hành Cloud trên Amazon - Huỳnh Kỳ Anh
 
FintechとID・サービス連携のエコシステム - OpenID Summit 2015
FintechとID・サービス連携のエコシステム - OpenID Summit 2015FintechとID・サービス連携のエコシステム - OpenID Summit 2015
FintechとID・サービス連携のエコシステム - OpenID Summit 2015
 
Trust Frameworkと法人番号について - OpenID Summit 2015
Trust Frameworkと法人番号について - OpenID Summit 2015Trust Frameworkと法人番号について - OpenID Summit 2015
Trust Frameworkと法人番号について - OpenID Summit 2015
 
King Tut Stella 6A
King Tut Stella 6AKing Tut Stella 6A
King Tut Stella 6A
 
(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...
(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...
(SEC304) Bring Your Own Identities – Federating Access to Your AWS Environmen...
 
SEC302 Delegating Access to Your AWS Environment - AWS re: Invent 2012
SEC302 Delegating Access to Your AWS Environment - AWS re: Invent 2012SEC302 Delegating Access to Your AWS Environment - AWS re: Invent 2012
SEC302 Delegating Access to Your AWS Environment - AWS re: Invent 2012
 
Cognito User Pool
Cognito User PoolCognito User Pool
Cognito User Pool
 
(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014
(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014
(SEC302) Delegating Access to Your AWS Environment | AWS re:Invent 2014
 
[会計freee] 2.スタートガイド
[会計freee] 2.スタートガイド[会計freee] 2.スタートガイド
[会計freee] 2.スタートガイド
 
AWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated BillingAWS Identity and Access Management and Consolidated Billing
AWS Identity and Access Management and Consolidated Billing
 

Similar to amazon-cognito-auth-in-minutes

Rapid Application Development on AWS
Rapid Application Development on AWSRapid Application Development on AWS
Rapid Application Development on AWSAmazon Web Services
 
Scaling your Mobile App Development in the Cloud - DevNexus
Scaling your Mobile App Development in the Cloud - DevNexusScaling your Mobile App Development in the Cloud - DevNexus
Scaling your Mobile App Development in the Cloud - DevNexusTara Walker
 
Build Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesBuild Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesAmazon Web Services
 
Security Best Practices for Serverless Applications - July 2017 AWS Online T...
Security Best Practices for Serverless Applications  - July 2017 AWS Online T...Security Best Practices for Serverless Applications  - July 2017 AWS Online T...
Security Best Practices for Serverless Applications - July 2017 AWS Online T...Amazon Web Services
 
Announcements for Mobile Developers
Announcements for Mobile DevelopersAnnouncements for Mobile Developers
Announcements for Mobile DevelopersAmazon Web Services
 
Build Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesBuild Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesAmazon Web Services
 
ACDKOCHI19 - Enterprise grade security for web and mobile applications on AWS
ACDKOCHI19 - Enterprise grade security for web and mobile applications on AWSACDKOCHI19 - Enterprise grade security for web and mobile applications on AWS
ACDKOCHI19 - Enterprise grade security for web and mobile applications on AWSAWS User Group Kochi
 
Building Mobile Apps on AWS at Websummit Diublin
Building Mobile Apps on AWS at Websummit DiublinBuilding Mobile Apps on AWS at Websummit Diublin
Building Mobile Apps on AWS at Websummit DiublinAmazon Web Services
 
Add User Sign in and Management to your Apps with Amazon Cognito
Add User Sign in and Management to your Apps with Amazon CognitoAdd User Sign in and Management to your Apps with Amazon Cognito
Add User Sign in and Management to your Apps with Amazon CognitoAmazon Web Services
 
Serverless Geospatial Mobile Apps with AWS
Serverless Geospatial Mobile Apps with AWSServerless Geospatial Mobile Apps with AWS
Serverless Geospatial Mobile Apps with AWSAmazon Web Services
 
Day 2 - Delivering Media Mobile Apps Using the AWS Mobile & Javascript SDKs
Day 2 - Delivering Media Mobile Apps Using the AWS Mobile & Javascript SDKsDay 2 - Delivering Media Mobile Apps Using the AWS Mobile & Javascript SDKs
Day 2 - Delivering Media Mobile Apps Using the AWS Mobile & Javascript SDKsAmazon Web Services
 
Serverless Geospatial Mobile Apps with AWS
Serverless Geospatial Mobile Apps with AWSServerless Geospatial Mobile Apps with AWS
Serverless Geospatial Mobile Apps with AWSAmazon Web Services
 
Delivering Mobile Apps Using AWS Mobile Services
Delivering Mobile Apps Using AWS Mobile ServicesDelivering Mobile Apps Using AWS Mobile Services
Delivering Mobile Apps Using AWS Mobile ServicesAmazon Web Services
 
AWS April Webinar Series - Easily Build and Scale Mobile Apps with AWS Mobile...
AWS April Webinar Series - Easily Build and Scale Mobile Apps with AWS Mobile...AWS April Webinar Series - Easily Build and Scale Mobile Apps with AWS Mobile...
AWS April Webinar Series - Easily Build and Scale Mobile Apps with AWS Mobile...Amazon Web Services
 
Journey Through the Cloud - Mobile & Social Apps
Journey Through the Cloud - Mobile & Social AppsJourney Through the Cloud - Mobile & Social Apps
Journey Through the Cloud - Mobile & Social AppsAmazon Web Services
 
AWS Mobile Services & SDK Introduction & Demo
AWS Mobile Services & SDK Introduction & DemoAWS Mobile Services & SDK Introduction & Demo
AWS Mobile Services & SDK Introduction & DemoAmazon Web Services
 
Build Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesBuild Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesAmazon Web Services
 
Build a mobile app serverless with AWS Lambda
Build a mobile app serverless with AWS LambdaBuild a mobile app serverless with AWS Lambda
Build a mobile app serverless with AWS LambdaTheFamily
 
Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...Amazon Web Services
 

Similar to amazon-cognito-auth-in-minutes (20)

Rapid Application Development on AWS
Rapid Application Development on AWSRapid Application Development on AWS
Rapid Application Development on AWS
 
Building Secure Mobile APIs
Building Secure Mobile APIsBuilding Secure Mobile APIs
Building Secure Mobile APIs
 
Scaling your Mobile App Development in the Cloud - DevNexus
Scaling your Mobile App Development in the Cloud - DevNexusScaling your Mobile App Development in the Cloud - DevNexus
Scaling your Mobile App Development in the Cloud - DevNexus
 
Build Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesBuild Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile Services
 
Security Best Practices for Serverless Applications - July 2017 AWS Online T...
Security Best Practices for Serverless Applications  - July 2017 AWS Online T...Security Best Practices for Serverless Applications  - July 2017 AWS Online T...
Security Best Practices for Serverless Applications - July 2017 AWS Online T...
 
Announcements for Mobile Developers
Announcements for Mobile DevelopersAnnouncements for Mobile Developers
Announcements for Mobile Developers
 
Build Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesBuild Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile Services
 
ACDKOCHI19 - Enterprise grade security for web and mobile applications on AWS
ACDKOCHI19 - Enterprise grade security for web and mobile applications on AWSACDKOCHI19 - Enterprise grade security for web and mobile applications on AWS
ACDKOCHI19 - Enterprise grade security for web and mobile applications on AWS
 
Building Mobile Apps on AWS at Websummit Diublin
Building Mobile Apps on AWS at Websummit DiublinBuilding Mobile Apps on AWS at Websummit Diublin
Building Mobile Apps on AWS at Websummit Diublin
 
Add User Sign in and Management to your Apps with Amazon Cognito
Add User Sign in and Management to your Apps with Amazon CognitoAdd User Sign in and Management to your Apps with Amazon Cognito
Add User Sign in and Management to your Apps with Amazon Cognito
 
Serverless Geospatial Mobile Apps with AWS
Serverless Geospatial Mobile Apps with AWSServerless Geospatial Mobile Apps with AWS
Serverless Geospatial Mobile Apps with AWS
 
Day 2 - Delivering Media Mobile Apps Using the AWS Mobile & Javascript SDKs
Day 2 - Delivering Media Mobile Apps Using the AWS Mobile & Javascript SDKsDay 2 - Delivering Media Mobile Apps Using the AWS Mobile & Javascript SDKs
Day 2 - Delivering Media Mobile Apps Using the AWS Mobile & Javascript SDKs
 
Serverless Geospatial Mobile Apps with AWS
Serverless Geospatial Mobile Apps with AWSServerless Geospatial Mobile Apps with AWS
Serverless Geospatial Mobile Apps with AWS
 
Delivering Mobile Apps Using AWS Mobile Services
Delivering Mobile Apps Using AWS Mobile ServicesDelivering Mobile Apps Using AWS Mobile Services
Delivering Mobile Apps Using AWS Mobile Services
 
AWS April Webinar Series - Easily Build and Scale Mobile Apps with AWS Mobile...
AWS April Webinar Series - Easily Build and Scale Mobile Apps with AWS Mobile...AWS April Webinar Series - Easily Build and Scale Mobile Apps with AWS Mobile...
AWS April Webinar Series - Easily Build and Scale Mobile Apps with AWS Mobile...
 
Journey Through the Cloud - Mobile & Social Apps
Journey Through the Cloud - Mobile & Social AppsJourney Through the Cloud - Mobile & Social Apps
Journey Through the Cloud - Mobile & Social Apps
 
AWS Mobile Services & SDK Introduction & Demo
AWS Mobile Services & SDK Introduction & DemoAWS Mobile Services & SDK Introduction & Demo
AWS Mobile Services & SDK Introduction & Demo
 
Build Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile ServicesBuild Your Mobile App Faster with AWS Mobile Services
Build Your Mobile App Faster with AWS Mobile Services
 
Build a mobile app serverless with AWS Lambda
Build a mobile app serverless with AWS LambdaBuild a mobile app serverless with AWS Lambda
Build a mobile app serverless with AWS Lambda
 
Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
Build Your Mobile App Faster with AWS Mobile Services (Cognito, Lambda, SNS, ...
 

amazon-cognito-auth-in-minutes

  • 1.
  • 2. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Vladimir Budilov, Technical Account Manager 6/21/2016 Workshop: How to Architect User Authentication and Authorization in Your Apps
  • 3. What to expect from this session? • High-level overview of AWS Mobile Services • Deep dive into Amazon Cognito, specifically Cognito User Pools • Walkthrough of a ready-to-use Angular 2 app powered by Cognito • How to store & manage users without creating a line of server-side code (no plumbing needed!)
  • 6. AWS Mobile SDKs Authenticate users Analyze User Behavior Store and share media Synchronize data Deliver media Amazon Cognito (Sync) Amazon Cognito (Identity) Amazon S3 Amazon CloudFront Store data Amazon DynamoDB Track Retention Amazon Mobile Analytics Send push notifications Amazon SNS Mobile Push Server-side logic Lambda Device Farm Test your app Build and Scale Your Apps on AWS Amazon Mobile Analytics
  • 7. What is Amazon DynamoDB? • Managed NoSQL database service • Consistent, low latency performance (single digit ms) at any scale • Predictable provisioned throughput • High durability and availability (3x replication) DynamoDB
  • 8. What is Amazon S3? • Cloud storage • Static website hosting • 11 9’s of Durability • 4 9’s of Availability • CloudFront Integration
  • 9. Undifferentiated Heavy Lifting of Authentication • Create and secure a database • Create the UI • Create the server-side code • Create the IdP access token verification logic • Consolidate IdP credentials • Generate and manage a custom secure token • Manage the token lifespan • Manage the user lifecycle
  • 11. Manage authenticated and guest users’ access to your AWS resources Federated Identities Synchronize user’s data across devices and platforms via the cloud Data Synchronization Add sign-up and sign- in with a fully managed user directory Your User Pool GuestYour own auth Amazon Cognito Identity Amazon Cognito Sync k/v data What’s Amazon Cognito?
  • 12. Amazon Cognito Federated Identities • Authenticate Users with third-party IdPs • Authenticate with Cognito User Pool • Anonymous Identities • Federation of Identities • OpenID Connect Token Generation • Control access from your app to other AWS Services
  • 13. Amazon Cognito Sync • Store Customer Data in the Cloud • Synchronize Data • Cognito Events Trigger AWS Lambda Functions • Cognito Streams Send Data to Amazon Kinesis
  • 14. Amazon Cognito User Pools Add sign-up and sign-in easily to your mobile and web apps Easy User Management Verify phone numbers and email addresses and offer multi-factor authentication Enhanced Security Features Launch a simple, secure, low-cost, and fully managed service to create and maintain a user directory that scales to 100s of millions of users Managed User Directory
  • 15. Comprehensive User Scenarios Email or phone number Verification Forgot Password User sign-up and sign- in Users verify their email address or phone number prior to activating an account Users can change their password if they forget it Users sign-up using email, phone number or user name and password. Users can then sign-in. User Profile Retrieve and update user profiles, including custom attributes SMS-based MFA If enabled, users complete Multi-Factor Authentication (MFA) with a confirmation code via SMS as part of sign-in and forgot password flows
  • 16. Customization using Lambda hooks Lambda Hook Example Scenarios Pre user sign-up Custom validation to accept or deny the sign-up request Custom message Advanced customization and localization of verification messages Pre user sign-in Custom validation to accept or deny the sign-in request Post user sign-in Event logging for custom analytics Post user confirmation Custom welcome messages or event logging for custom analytics
  • 17. Comprehensive Administrator Scenarios Manage users in a User Pool Select Email and Phone Verification Customize with Lambda Triggers Setup Password Policies Create and manage User Pools List, search and perform actions on specific user(s) in the User Pool Configure verifications of users’ email addresses and phone numbers (via SMS) Create functions in AWS Lambda to customize workflows Control password requirements like minimum length, uppercase, and inclusion of special characters Create, configure and delete multiple User Pools in their AWS account Define Attributes Select required attributes and Define custom user attributes
  • 18. Secure Sign-in Made Easy Token-based Authentication Secure Remote Password Protocol SMS-based Multi-factor Authentication Uses tokens based on OpenID Connect (OIDC) and OAuth 2.0 standards Uses Secure Remote Password (SRP) for secure password handling end to end Enables your end users to use the text messaging functionality of a mobile phone as an extra layer of security
  • 21. Authentication Flow Amazon Cognito User Pools Amazon DynamoDB Mobile apps Lets walk through this step by step…S3 Lambda Hooks Amazon Cognito Identities
  • 22. Authentication Flow Amazon Cognito User Pools Amazon DynamoDB Mobile apps Step 0: User invokes the website hosted on S3 Amazon S3 can be used as a highly available website hosting platform Lambda Hooks Amazon Cognito Identities S3
  • 23. Authentication Flow Amazon Cognito User Pools Mobile apps Step 1: User signs up for an account with our Amazon Cognito User Pool, providing their email & password (+ any custom attributes). Amazon Cognito can automatically verify the user’s email address and/or phone number if required. S3 Amazon DynamoDB Lambda Hooks Amazon Cognito Identities
  • 24. Authentication Flow Amazon Cognito User Pools Mobile apps Step 2: At some point in the future, the user wants to sign in. We can now authenticate the user. Amazon DynamoDB Lambda Hooks Amazon Cognito Identities S3
  • 25. Authentication Flow Amazon Cognito User Pools Mobile apps Optional: If MFA is enabled (either for this user, or all users), Amazon Cognito will SMS a one time authentication code to the user. Amazon DynamoDB Lambda Hooks Amazon Cognito Identities S3
  • 26. Authentication Flow Amazon Cognito User Pools Mobile apps Optional: If Lambda Hooks are setup, then they will be invoked Amazon DynamoDB Lambda Hooks S3 Amazon Cognito Identities
  • 27. Authentication Flow Amazon Cognito User Pools Mobile apps Step 3: After a successful authentication, Amazon Cognito responds with a signed JSON Web Token (JWT) containing the user’s details. Amazon DynamoDB Lambda Hooks S3 Amazon Cognito Identities
  • 28. Authentication Flow Amazon Cognito User Pools Mobile apps Step 4: Once you’re authenticated, you want to retrieve your scoped AWS credentials to access other services. Amazon DynamoDB Lambda Hooks S3 Amazon Cognito Identities
  • 29. Authentication Flow Amazon Cognito User Pools Mobile apps Step 5: You are now ready to call DynamoDB. Amazon DynamoDB Lambda Hooks S3 Amazon Cognito Identities
  • 30. Going serverless Amazon Cognito User Pools Amazon API Gateway Lambda Hooks /v1 Lambda Function /v2… Lambda Function Amazon DynamoDB Throttling Cache Logging Monitoring Auth Mobile apps This is a more complete solution that you can achieve without managing servers… S3 Amazon Cognito Identities
  • 31. Getting started with the QuickStart app
  • 32. Tech Stack • Required Tools • aws cli • npm • bower • angular-cli • Frameworks • AWS JavaScript SDK & Amazon Cognito Libraries • Angular 2 (Ionic) RC2 • TypeScript • Bootstrap
  • 33. Get The QuickStart App # Clone it from github git clone --depth 1 git@github.com:awslabs/aws-cognito-angular2-quickstart.git # Install the NPM and Bower packages npm install bower install # Run the app in dev mode npm start # Build the project and sync the output with the S3 bucket ng build cd dist aws s3 sync . s3://your-unique-bucket-name/ # Test it out curl –I http://your-unique-bucket-name.s3-website-us-east-1.amazonaws.com/
  • 36. Types • ID Token • JWT • OpenID Identity Information (name, phone_number, etc) • Access Token • JWT • No Identity Information • Used for further authorizations • Refresh Token • String • Refresh Amazon Cognito Identity session
  • 37. ID Token • Header • kid – used to locate the public key • alg – RS256 • Payload • user attributes (user identity information) • iss – the issuer • sub – UUID of the authenticated user • token_use – the purpose of the token • Signature • Based on header and payload
  • 38. Access Token • Header • kid – different from ID token since different keys used • alg – RS256 • Payload • username – (e.g. vladimir@budilov.com) • Signature • Based on header and payload