amazon-cognito

How setup header in Postman for Api Gateway authenticated with Cognito?

拈花ヽ惹草 提交于 2019-11-30 03:48:13
问题 I use AWS Identity Pool with Facebook provider to authenticate client. I need to invoke AWS Lambda using Api Gateway. From Cognito, using Facebook token, i received credentials: AccessKeyId, SecretKey and SessionToken. Using this credentials, how should I setup header request to invoke my Lambda? Api Gateway setup (test calls my lambda) I try to call my api, it returns "The security token included in the request is invalid." Thank you! 回答1: You have to manually set ' x-amz-security-token ' in

implementing USER_SRP_AUTH with python boto3 for AWS Cognito

痴心易碎 提交于 2019-11-30 03:18:58
问题 Amazon provides iOS, Android, and Javascript Cognito SDKs that offer a high-level authenticate-user operation. For example, see Use Case 4 here: https://github.com/aws/amazon-cognito-identity-js However, if you are using python/boto3, all you get are a pair of primitives: cognito.initiate_auth and cognito.respond_to_auth_challenge . I am trying to use these primitives along with the pysrp lib authenticate with the USER_SRP_AUTH flow, but what I have is not working. It always fails with "An

AppSync: Get user information in $context when using AWS_IAM auth

一笑奈何 提交于 2019-11-30 02:14:59
In AppSync, when you use Cognito User Pools as your auth setting your identity you get identity: { sub: 'bcb5cd53-315a-40df-a41b-1db02a4c1bd9', issuer: 'https://cognito-idp.us-west-2.amazonaws.com/us-west-2_oicu812', username: 'skillet', claims: { sub: 'bcb5cd53-315a-40df-a41b-1db02a4c1bd9', aud: '7re1oap5fhm3ngpje9r81vgpoe', email_verified: true, event_id: 'bb65ba5d-4689-11e8-bee7-2d0da8da81ab', token_use: 'id', auth_time: 1524441800, iss: 'https://cognito-idp.us-west-2.amazonaws.com/us-west-2_oicu812', 'cognito:username': 'skillet', exp: 1524459387, iat: 1524455787, email: 'myemail@nope.com'

How do I look up a cognito user by their sub/UUID?

我们两清 提交于 2019-11-30 01:53:17
问题 I want to look up a user in my Cognito user pool by their sub, which as far as I can tell, is just their UUID. I would like to do this in Java within a Lambda function but cannot find how to do this in AWS's documenation. Any thoughts? 回答1: As of today this is not possible with Cognito User Pools. Users can only be looked up using their username or aliases. ListUsers API also allows users to be searched by providing search filters on some standard attributes but sub is not one of them. 回答2:

What is the REST (or CLI) API for logging in to Amazon Cognito user pools

元气小坏坏 提交于 2019-11-30 01:50:47
How do i make logins happen via Amazon Cognito REST APIs (for user pools) on platforms for which there is no official SDK? - Note that i am asking for user pools - not identity pools. Synopsis Amazon cognito provides 3 kinds of logins: federated logins (creates identity pools ) - using social connects like FB, Twitter, G+ etc AWS managed logins (creates user pools ) - using Amazon's own managed signup, signin, forgot password, reset password services developer provided logins (my custom designed authentication service managed by myself) I am using the second one (with User Pools) Amazon

AWS Cognito User Pools in iOS (Swift) app

╄→尐↘猪︶ㄣ 提交于 2019-11-29 21:55:03
I'm trying to implement the new AWS Cognito User Pools in my iOS (Swift) app, but I'm struggling to get the sign in process to work. I am essentially trying to follow the example available here . This is what I have so far: AppDelegate: class AppDelegate: UIResponder, UIApplicationDelegate, AWSCognitoIdentityInteractiveAuthenticationDelegate { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let serviceConfiguration = AWSServiceConfiguration(region: AWSRegionType.USEast1, credentialsProvider: nil) AWSServiceManager

Cognito User Pool: How to refresh Access Token using Refresh Token

混江龙づ霸主 提交于 2019-11-29 21:20:39
I am using Cognito user pool to authenticate users in my system. A successful authentication gives an ID Token (JWT), Access Token (JWT) and a Refresh Token. The documentation here, http://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html , clearly mentions that the refresh token can be used to refresh access token, but does not mention how. My question is once my Access Token expires, how do I use the stored refresh token to refresh my access token again? I searched through the javascript sdk and could not find any method to

How to use Federation from a User Pool (not from an Identity Pool)!

让人想犯罪 __ 提交于 2019-11-29 16:26:19
I'm trying to use Federation from a User Pool . Note, I am not talking about Federated Identity Pool a different concept. Is there a SignIn API for federated users or is just a hosted UI Does the app "have to" open a browser on a Sign In URL that looks like https://XXXXXX.au=th.XXXXX.amazoncognito.com/login?response_type=code&client_id=XXXXXXXXX&redirect_uri=XXXXXXX ? Can the end-user can stay inside the app, similar to how Google SignIn API on Android works (it pops up a small Google sign in UI, user clicks on their name, you're immediately back inside the app with a token. How do I launch a

AWS Cognito Invalid identity pool configuration

空扰寡人 提交于 2019-11-29 11:31:37
问题 I am using the AWS Javascript API and trying to get the assigned cognito id: AWS.config.credentials.get(function(err) { if (!err) { console.log("Cognito Identity Id: " + AWS.config.credentials.identityId); } }); Why does this result in a 400 error with the message below? {"__type":"InvalidIdentityPoolConfigurationException","message":"Invalid identity pool configuration. Check assigned IAM roles for this pool."} I have IAM roles configured for authenticated and non-authenticated users. {

How to call API Gateway with Cognito Credentials through retrofit2 on Android?

元气小坏坏 提交于 2019-11-29 09:41:10
问题 I use retrofit2 in my android apps for any http/rest call. Now I need to call an api generated with Amazon AWS API Gateway. The AWS documentation say I should generate the client code throw the API Gateway console and use the class ApiClientFactory to build the request: ApiClientFactory factory = new ApiClientFactory(); // Use CognitoCachingCredentialsProvider to provide AWS credentials // for the ApiClientFactory AWSCredentialsProvider credentialsProvider = new