amazon cognito

32
Authenticate users Authorize access Synchronize app state Manage users and identity providers Securely access cloud resources Sync user prefs across devices Media sharing mobile app Send push notifications Store shared data Store media Store user-generated photos Media and share them Bring users back to your app by sending messages reliably Store and query fast NoSQL data across users and devices Collect real-time clickstream logs and take actions quickly Stream real-time data

Upload: amazon-web-services

Post on 11-Aug-2015

349 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Amazon Cognito

Authenticate users

Authorize access

Synchronize app state

Manage users and

identity providers

Securely access

cloud resources

Sync user prefs

across devices

Media

sharing

mobile

app

Send push notifications

Store shared data

Store mediaStore user-generated photos

Media and share them

Bring users back to your app by sending

messages reliably

Store and query fast NoSQL data

across users and devices

Collect real-time clickstream logs

and take actions quickly

Stream real-time data

Page 2: Amazon Cognito

Authenticate users

Authorize access

Synchronize app state Send push notifications

Amazon Cognito

(Identity Broker)

AWS Identity and

Access Management

Amazon Cognito

(Sync) Amazon SNS

Mobile Push

Store and share media

Amazon S3

Transfer Manager

Store shared dataAmazon DynamoDB

(Object Mapper)

Stream real-time dataAmazon Kinesis

(Recorder)

Media

sharing

mobile

app

Page 3: Amazon Cognito

User identity and sync with Amazon Cognito

Page 4: Amazon Cognito

Amazon Cognito Overview

Manage authenticated

and guest users across

identity providers

Identity Management

Synchronize user’s data

across devices and

platforms via the cloud

Data Synchronization

Securely access AWS

services from mobile devices and platforms

Secure AWS Access

Guest

Page 5: Amazon Cognito

Amazon Cognito: Use cases

Page 6: Amazon Cognito

Identity across the web and mobile

Page 7: Amazon Cognito

State transition

Page 8: Amazon Cognito

State transition

Page 9: Amazon Cognito

State transition

Page 10: Amazon Cognito

Game state

Page 11: Amazon Cognito

Amazon Cognito: Identity

Page 12: Amazon Cognito

Amazon Cognito

Identity

Providers

Unique

IdentitiesJoe Anna Bob

Any Device

Any Platform

Any AWS

Service

Helps implement security best practicesSecurely access any AWS Service from mobile device. It simplifies the interaction with AWS Identity and Access Management

Support Multiple Login ProvidersEasily integrate with major login providers for authentication.

Unique Users vs. DevicesManage unique identities. Automatically recognize unique user across devices and platforms.

Mobile

AnalyticsS3 DynamoDB Kinesis

Page 13: Amazon Cognito

Amazon Cognito unauthenticated

Unique Identifier for Your “Things”“Headless” connected devices can also securely access cloud services.

Save Data to the CloudSave app and device data to the cloud and merge them after login

Guest User AccessSecurely access AWS resources and leverage app features without the need to create an account or logging in

Visitor

Preferences

Cognito

Store

Guest

EC2 S3 DynamoDB Kinesis

Page 14: Amazon Cognito

Amazon Cognito Authenticated Flow

Page 15: Amazon Cognito

Developer Authenticated Identities – Support Any Login

Page 16: Amazon Cognito

Amazon Cognito: Security best practices

Page 17: Amazon Cognito

Amazon Cognito Security

Set granular access permissions on AWS resourcesGet fine-grained access control to cloud resources.

Safeguard AWS CredentialsNo need to embed credentials in the app anymore. Get least-privileged temporary credentials.

Helps implement security best practicesSecurely access any AWS Service. It simplifies the interaction with Security Token Service and removes the need of Token Vending Machine

EC2 S3 DynamoDB Kinesis

Page 18: Amazon Cognito

Amazon Cognito: Cloud sync

Page 19: Amazon Cognito

What have customers told us about “Synchronized

Profile”

People have multiple devices and want to transition between devices.

Implementing a user profile that syncs across devices, OS, apps is hard.

It not only has to work when offline, but easy to integrate with existing apps.

Page 20: Amazon Cognito

Amazon Cognito Sync Features

• Store App Data, Preferences and StateSave app and user data to the cloud

• Work OfflineData persisted to local storage first. Local data is

available regardless of connectivity

• No BackendSimple client SDK eliminates need for server side

codeUser

Data

Identity Pool

Page 21: Amazon Cognito

Sync Data Model

• Identity Pool: Pool of app users. Can be

shared across apps.

• Identity: An individual user. Consistent

across identity providers. Can be a guest

user.

• Dataset: Per user grouping of data. The

most granular level of sync. Up to 1MB.

• Record: Key/Value pair user data

AWS Account

Dataset

IdentityIdentityIdentity

DatasetDataset

Identity

Pool

1:60

1:n

1:20

DatasetDatasetRecord

1:1024

Page 22: Amazon Cognito

Let’s build our app

2. Identity with Amazon Cognito

Page 23: Amazon Cognito

Amazon Cognito Security Architecture

End Users

App with

AWS Mobile

SDK

Access

to AWS

Services

Login OAUTH/OpenID

Access Token

Cognito ID,

Temp

Credentials

Access

Token

Pool ID

Role ARNs

Cognito ID

(Temp

Credentials)

DynamoDB

Developer

Cognito Identity

S3

Mobile Analytics

Cognito Sync

Store

AWS

Management

Console

Page 24: Amazon Cognito
Page 25: Amazon Cognito
Page 26: Amazon Cognito
Page 27: Amazon Cognito
Page 28: Amazon Cognito

Create an unauthenticated identity

AWSCognitoCredentialsProvider *credentialsProvider =[AWSCognitoCredentialsProvider credentialsWithRegionType:AWSRegionUSEast1

accountId:@"AWS_ACCOUNT_ID"identityPoolId:@"COGNITO_IDENTITY_POOL"

unauthRoleArn:@"arn:aws:iam::AWS_ACCOUNT_ID:role/UNAUTHENTICATED_ROLE"

authRoleArn:@"arn:aws:iam::AWS_ACCOUNT_ID:role/AUTHENTICATED_ROLE"];

AWSServiceConfiguration *configuration = [AWSServiceConfigurationconfigurationWithRegion:AWSRegionUSEast1

credentialsProvider:credentialsProvider];

[AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;

Page 29: Amazon Cognito

Link a social profile, authenticated identities

NSString *token = FBSession.activeSession.accessTokenData.accessToken;credentialsProvider.logins = @{ @(AWSCognitoLoginProviderKeyFacebook): token };

• Logins is a Map• Can contain tokens from all supported providers

• Amazon• Facebook• Google• Your own identity system

Page 30: Amazon Cognito

Identity state changes

[[NSNotificationCenter defaultCenter] addObserver:selfselector:@selector(identityIdDidChange:)

name:AWSCognitoIdentityIdChangedNotificationobject:nil];

-(void)identityDidChange:(NSNotification*)notification {NSDictionary *userInfo = notification.userInfo;NSLog(@"identity changed from %@ to %@",

[userInfo objectForKey: AWSCognitoNotificationPreviousId],[userInfo objectForKey: AWSCognitoNotificationNewId]);

}

Page 31: Amazon Cognito

Let’s build our app

3. Synchronize app state

Page 32: Amazon Cognito

Save and sync preferences and state

// Create sync client and open dataset

AWSCognito *syncClient = [AWSCognito defaultCognito];

AWSCognitoDataset *dataset = [syncClient openOrCreateDataset:@”mediashare"];

// Save the current state of the application

[dataset setString:self.currentPhotoName forKey:@”latest_photo"];

[dataset synchronize];