Skip to content

AWS Cognito Service

Updated: at 01:00 AM

Cognito Service

Instead of building own user management, AWS offers much simpler solution with Cognito. It used for AuthN & AuthZ (sign-in/sign-up/access control)

Table of Content

Typical Use Cases

Other Cognito Benefits

Cognito Pools

Cognito comprises two services - User Pools, Identity Pools

User Pools

Identity Pools

# Finding UserPoolId
aws cognito-idp list-user-pools --max-results 10

# Finding IdentityPoolId
aws cognito-identity list-identity-pools --max-results 10

# Finding App ClientId
aws cognito-idp list-user-pool-clients --user-pool-id us-east-1_ttddaXuA0

S3 Bucket Access Process

sequenceDiagram autonumber App->>UserPool: Authentication Request UserPool->>UserPool: Verify Credentials UserPool->>App: JWT App->>IdentityPool: JWT IdentityPool->>STS: Assume Role STS->>App: AWS Credentials (access key, secret key) App->>S3: S3 bucket access with AWS Credentials

This process ensures secure access to S3 resources by using AWS Cognito for user authentication and temporary credentials for authorizing access to AWS resources. This also follows the best practice of not embedding long-term AWS credentials within the client application.

Cognito Token Process