amazon-cognito

How to get and update user attributes AWS amplify angular 6

三世轮回 提交于 2019-12-06 07:47:32
问题 How would I change the attributes of the Cognito user after sign up into the application? What API should be used to fetch the details of the user like First Name, Last Name etc? What API should be used to update the user details? 回答1: To fetch the details of the user, simply use this.amplifyService.auth().currentAuthenticatedUser() and retrieve the user.attributes fields. /** * Get current authenticated user * @return - A promise resolves to curret authenticated CognitoUser if success */

AWS ApiGateway Lambda Proxy access Authorizer

家住魔仙堡 提交于 2019-12-06 07:29:34
问题 I´m using an Lambda Proxy and a Cognito User Pool Authorizer in my ApiGateway. In the Lambda function I can access the path etc. variables via the event object. In addition to that I want to access the claims of the authenticated user. In the documentation it is written, that I should use: context.authorizer.claims.property But I authorizer is null so I get Cannot read property 'claims' of undefined Anyone with an idea? 回答1: If you are referring to this part of the documentation, $context

AWS Cognito, Lambda, User credentials in DynamoDB

五迷三道 提交于 2019-12-06 03:59:43
问题 I established a authentication flow with Facebook Login and AWS Cognito on the client site. Works fine. But now I need a reference of the user with its facebook id in a dynambodb table. Of course I could just call a AWS lambda function exposed via AWS API gateway, but how can I verify that the API call actually has a valid facebook id and that this facebook id matches the AWS Cognito Id. Maybe I am missing something here, I hope you guys can point me in the right direction ;) thanks! 回答1: If

Using Amazon Mobile Analytics without configuring Amazon Cognito

为君一笑 提交于 2019-12-06 03:28:18
Compared to competing analytics services, Amazon Mobile Analytics appear to require many more configuration and integration steps. For example, in Flurry Analytics, the setup is pretty simple: [Flurry startSession:@"<app-id>"]; [Flurry logEvent:@"<event-name>"]; // Optionally, set the userID [Flurry setUserID:@"userid"]; I was hoping the equivalent in Amazon Mobile Analytics would be something like this for unauthenticated users: [AWSLogger defaultLogger].logLevel = AWSLogLevelVerbose; AWSMobileAnalytics* analytics = [AWSMobileAnalytics mobileAnalyticsForAppId:@"<app-id>"]; id

When does API Gateway validate revoked Cognito ID token

僤鯓⒐⒋嵵緔 提交于 2019-12-06 03:24:43
问题 I am building a serverless react app which uses Cognito for sign-in/sign-out. The app calls API Gateway which is configured to use the Cognito User pool as the custom authorizer. I also build a lambda function to sign out a user ( cognitoIdentityServiceProvider.globalSignOut ). When I sign into the app, and then call the lambda function to perform an admin sign-out, calls to protected API gateway functions from the app are still valid (with Cognito ID token passed in Authorization header);

Creating a user/developer defined login for AWS iOS using iOS SDK Cognito Lambda and DynamoDB

允我心安 提交于 2019-12-06 00:18:50
I am trying to figure out if this is the "proper"/current/correct flow for developing a user/developer defined login credential for iOS using AWS. (I am migrating from Parse to AWS so only been reading AWS for a week). Download, install, and build an iOS app for registering users (say email and password (this is done and the app shows a UITextField for email and password and accessible in the UIViewController)). Also iOS SDK via Cocoapods is installed and available. Create an identity pool with an unauth and auth roles that access the different services. So unauth technically will access what

Cognito / S3 User Specific Policies

寵の児 提交于 2019-12-05 21:04:02
I am using the AWS SDK for Android alongside Cognito to authenticate users (via Login With Amazon) to my AWS resources. What I am attempting to do is to setup an S3 bucket like so: ./my-bucket ├── first_user@email.com └── second_user@email.com So, the my-bucket bucket will have folders based on the user's e-mail address. My first stab to setup the policy was as such: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": ["arn:aws:s3:::my-bucket"] }, { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:DeleteObject" ], "Resource"

Forgot password link from aws cognito

孤街浪徒 提交于 2019-12-05 20:30:59
问题 I started exploring AWS cognito for my dummy ios application, although I am getting a confirmation link in email during new user signup, and clicking on it verifies the email correctly. Do we have same functionality for forgot password i.e. getting a link instead of codes and redirect it to my dummy website where only thing user needs to do is enter is new password. Thanks in advance. 回答1: Its possible I have achieved this in my project. Its done via triggers in aws cognito. In Custom message

How to restore an expired token [AWS Cognito]?

拥有回忆 提交于 2019-12-05 16:40:06
问题 I'm using AWS for my website. After 1 hour the token expires and the user pretty much can't do anything. For now i'm trying to refresh the credentials like this: function getTokens(session) { return { accessToken: session.getAccessToken().getJwtToken(), idToken: session.getIdToken().getJwtToken(), refreshToken: session.getRefreshToken().getToken() }; }; function getCognitoIdentityCredentials(tokens) { const loginInfo = {}; loginInfo[`cognito-idp.eu-central-1.amazonaws.com/eu-central-1_XXX`] =

User pools for users who register via twitter?

醉酒当歌 提交于 2019-12-05 15:52:25
I'm new to Cognito. So I need some clarification about how I should be registering users who have signed up via a social login. I've created both a user pool and a federated identity pool. Then I performed a basic oauth request to twitter upon the user's login button click, and then with the twitter token and secret that I receive after successfully logging them in, I perform a request to get Cognito Identity credentials. var params = { IdentityPoolId: 'my-pool-id', Logins: { 'api.twitter.com': userToken+";"+userSecret } }; // initialize the Credentials object with our parameters AWS.config