amazon-cognito

How to set a dynamic RoleMappings key for a IndentityPoolRoleAttachment in CloudFormation

好久不见. 提交于 2019-12-10 15:53:15
问题 I am building a stack to initialize a Cognito installation. As part of this I have setup user groups with associated roles. I need to set the Choose role from token option, allowing identities to use roles from the group(s) to which they are assigned. This is done through the RoleMappings object in the IndentityPoolRoleAttachment object. This mappings object is a string -> object map, where the string represents the identity provider. In my case, this is: cognito-idp.${some-region}.amazonaws

How to allow only email as username alias with CloudFormation?

早过忘川 提交于 2019-12-10 14:03:22
问题 Following this guide, it says: On the Attributes tab, select Email address or phone number and select Allow email addresses. Which looks like this: But I'm having trouble accomplishing the same thing with CloudFormation. Tried a couple of the obvious attributes but did not work. Thoughts? 回答1: It's now possible to do this by setting the UsernameAttributes property to an array of strings containing either email , phone_number or both: Type: AWS::Cognito::UserPool Properties: UsernameAttributes

hard-coding "identity-pool id' for 'aws cognito' is dangerous in security?

房东的猫 提交于 2019-12-10 12:09:41
问题 I am using aws cognito service for authentication with Unity3D. I wonder whether there is security problem if 'identity-pool id' is hardcoded to script. For the security, how do deveopers implement? Is there anybody to suggest? 回答1: If you plan on releasing the source code, exposing identities and authentication information is a bad idea. What you could do is make your code to fetch the Identity Pool ID from a separate file and commit that file that has the connection string, or in this case,

Upload to Amazon S3 with Amazon Cognito Login

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 11:49:31
问题 I am using the code below to sign up a user with Amazon Cognito. I would then like to upload a file to an Amazon S3 Bucket when the user signs up. What do I need to do to configure the bucket ready to upload, once the user has signed up? Thank you var roleArn = 'arn:aws:iam::123456:role/Cognito_Auth_Role'; var bucketName = 'MY_BUCKET'; AWS.config.region = 'eu-west-1'; var poolData = { UserPoolId : 'POOL_ID', // your user pool id here ClientId : 'CLIENT_ID' // your app client id here }; var

How to get Cognito user pool “sub” attribute on iOS

可紊 提交于 2019-12-10 11:28:09
问题 I am using a "Cognito User Pool authorizer" (no "AWS_IAM" option, no custom coded authorizer) to call Lambda methods via API Gateway and identify the user logged in on the iOS client. On Lambda, I use the user id I get from the Cognito User Pool authorizer via event.requestContext.authorizer.claims.sub (to store the user id with some DynamoDB items). I now need to compare this with the id of the logged in user in the iOS client. I found [AWSIdentityManager defaultIdentityManager].identityId ,

AWSCognito login blocked 1 time after logout - “Obtaining an identity id in another thread failed or didn't complete within 5 seconds.”

拟墨画扇 提交于 2019-12-10 11:06:21
问题 I tried to implement all the Cognito SignUp/Confirm/SignIn Stuff in a CognitoController singleton class. I think there are two functions where my problem probably is based: The first function is to re-establish a session and is called from my main view controller which receives the callback and then proceeds to initialize the session or shows the signInViewController: func handleSignInToExistingSession() { if AWSIdentityManager.default().identityId != nil { if AWSFacebookSignInProvider

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

一世执手 提交于 2019-12-10 09:45:48
问题 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

Given the user's identity id, how to get the user's details from cognito user pool?

谁说我不能喝 提交于 2019-12-10 09:35:54
问题 The user uploads an image to his/her subfolder on S3. The only way this can be enforced with policy is by using identity id: arn:aws:s3:::thebucket/${cognito-identity.amazonaws.com:sub}/avatar.jpg A lambda that transforms that image, is triggered, and saves the transformations to a different S3. But now, with the identity id on disposal, that lambda needs to update the user's db record with the references to the avatar transformations. This is where the issue is evident, I only have the

Getting full access to DynamoDB from my ios app using AWS Cognito Developer Identities

吃可爱长大的小学妹 提交于 2019-12-10 03:09:10
问题 I have implemented a AWS Lambda function and used the gateway to return the fulling data: var param = { IdentityPoolId: "actualIdentityPoolId", Logins: {} // To have provider name in a variable }; param.Logins["com.testing.userLogin"] = userId; cognitoidentity.getOpenIdTokenForDeveloperIdentity(param, function(err, data) { if (err) return fn(err); // an error occurred else fn(null, data.IdentityId, data.Token); // successful response }); So the identityId and token get sent back to the ios

Does API Gateway behind CloudFront not support AWS_IAM authentication?

我们两清 提交于 2019-12-09 14:38:21
问题 It seems that it is impossible to call a REST API that has AWS_IAM protection enabled through a CloudFront Distribution. Here is how to reproduce this: create a REST API with API Gateway protect a REST API method with AWS_IAM authentication create a CloudFront Distribution that targets the REST API create an A Record in Route 53 that targets the CloudFront Distribution Now use an authenticated user (I use Cognito UserPool user and aws-amplify) to call the protected REST API method with its