ActoKids / AD440_W19_CloudPracticum

3 stars 1 forks source link

Login page connecting to Cognito #65

Closed coultergeist closed 5 years ago

coultergeist commented 5 years ago

Connect the login page to Cognito (working with Zach from API team).

Once assigned, annotate your estimated time. Then, keep regular updates on your issue. Comment your approach, tutorials, articles, updates, links, photos, etc. Comment often. When closing your issue include the following in your final comment.

Time estimated: 3 hours Time spent: Pull Request link: Wiki link: Deployed Code link: Testers: What I tested:

coultergeist commented 5 years ago

Issue #77 created 26Feb2019 for AWS permissions (including Cognito)

Tutorials to start:

May try this:

// Initialize the Amazon Cognito credentials provider
CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider(
   getApplicationContext(),
   "us-east-1:163c7994-ce5d-480c-bd4a-86045414024d", // Identity pool ID
   Regions.US_EAST_1 // Region
);
coultergeist commented 5 years ago

Unable to create user pools in Cognito (see bug #77).

AWS>Cognito>Create User Pool>name pool>Review defaults....>Create then I see this error

cognito-error
coultergeist commented 5 years ago

Hours to date: 7

Still incorrect Cognito perms. Continuing to work with DevOps (see bug #77)

screen shot 2019-03-05 at 2 13 40 pm

There is a configured version on the ActoKids AWS account under API Team's Cognito (@ZakBrinlee's AWS Congito) See bug #87

coultergeist commented 5 years ago

Hours to date: 10

Cognito perms 50% complete:

There are two Cognito functions:

1) "Manage User Pools" - I am able to fully create a user pool. 2) "Manage Identity Pools" - Not authorized User: arn:aws:iam::061431082068:user/danielle.coulter@seattlecolleges.edu is not authorized to perform: iam:CreateRole on resource: arn:aws:iam::061431082068:role/Cognito_ActoKidsAuth_Role

Note: I (believe) I need DevOps to create a policy and a role that allows the people logging in to actually invoke the API.

coultergeist commented 5 years ago

Hours to Date: 11

Coding for User Login

Complete. Right now users can successfully log in (with API Team Cognito User Pool)

exerpt from config.js file: /* This is the UI Team Cognito Info. Remove above cognito info an uncomment this out

cognito: { REGION: 'us-east-2', USER_POOL_ID: 'us-east-2_otpHbMxKi', APP_CLIENT_ID: '7l7q1utlnmg3qnmlffc5n4otin', IDENTITY_POOL_ID: 'us-east-2:dee596e1-548a-466c-be33-e9bc5951811f' } */`

login

Once logged in, the user is successfully directed to Dashboard

dashboard
coultergeist commented 5 years ago

Time estimated: 3 hours Time spent: 16 hours Pull Request link:

Wiki link: Configuring Cognito Page for User Login Deployed Code link: 2edusite

Testers:

What I tested:

Additional Notes: