amazon-cognito

AWS CDK user pool authorizer

半城伤御伤魂 提交于 2020-05-25 17:49:37
问题 I'm trying to create an API gateway using the AWS-CDK and protect the REST endpoints with a Cognito user pool authorizer. I cannot find any examples how one would do this. I thought it should look something like this but maybe the methods I need do not exist? const cdk = require('@aws-cdk/cdk'); const lambda = require('@aws-cdk/aws-lambda'); const apigw = require('@aws-cdk/aws-apigateway'); const path = require('path'); // // Define the stack: class MyStack extends cdk.Stack { constructor

AWS-amplify Including the cognito Authorization header in the request

这一生的挚爱 提交于 2020-05-25 04:54:21
问题 I have create an AWS mobile hub project including the Cognito and Cloud logic. In my API gateway, I set the Cognito user pool for the Authorizers. I use React native as my client side app. How can I add the Authorization header to my API request. const request = { body: { attr: value } }; API.post(apiName, path, request) .then(response => { // Add your code here console.log(response); }) .catch(error => { console.log(error); }); }; 回答1: By default, the API module of aws-amplify will attempt

How to Restrict Custom api access using AWS Cognito

匆匆过客 提交于 2020-05-17 06:38:06
问题 I am using Spring Boot in my application. While searching for some IAM tools, I actually liked Auth0, but iam not affordable their pricing. So, I found another called AWS Cognito . Below is Auth0 to restrict our custom access api https://auth0.com/docs/api-auth/restrict-access-api Currently, I am trying to restrict access API using AWS cognito, but I am not finding correct documentation to achieve this. Can anyone please tell me whether restricting api access can be possible using aws cognito

How to delete the Cognito user in Node.js?

ぐ巨炮叔叔 提交于 2020-05-15 09:39:09
问题 How to delete user account from * cognito * in nodejs. I'm trying to delete the user from cognito it is not working for me. AWS config const AWS = require('aws-sdk'); const cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider(); Pool config const poolConfig = { UserPoolId: keys.cognito.userPoolId, ClientId: keys.cognito.clientId }; Above configurations comes on top of below delete function. Delete Function function deleteUserFunc(req, decodedToken) { return new Promise(

Getting cognito user pool username from cognito identity pool identityId

十年热恋 提交于 2020-05-14 16:12:51
问题 I am using AWS Congito User Pools for account management with a Cognito Identity Pool that has this User Pool as the Identity Provider. I'm using this to control access to an API through API Gateway that sends requests to Lambda. My Lambda is implemented with Java 8 using Micronaut. All of this is working fine. In the Lambda, I'm getting the name from the Principal in the HttpRequest : protected String resolveUser( HttpRequest request ){ String ret = null; Optional<Principal> principal =

Getting cognito user pool username from cognito identity pool identityId

梦想与她 提交于 2020-05-14 16:12:43
问题 I am using AWS Congito User Pools for account management with a Cognito Identity Pool that has this User Pool as the Identity Provider. I'm using this to control access to an API through API Gateway that sends requests to Lambda. My Lambda is implemented with Java 8 using Micronaut. All of this is working fine. In the Lambda, I'm getting the name from the Principal in the HttpRequest : protected String resolveUser( HttpRequest request ){ String ret = null; Optional<Principal> principal =

AWS Cognito: Best practice to handle same user (with same email address) signing in from different identity providers (Google, Facebook)

假如想象 提交于 2020-05-10 06:22:38
问题 When signing in a user with the same email address through the Google and Facebook identity providers, AWS Cognito creates multiple entries in the user pool, one entry per identity provider used: I have used the example code provided in this tutorial to set up AWS Cognito: The Complete Guide to User Authentication with the Amplify Framework How can I create just one user instead of multiple users? Is it possible to have AWS Cognito automatically combine (federate) the entries from multiple

How to modify expiry time of the access and identity tokens for AWS Cognito User Pools

烈酒焚心 提交于 2020-05-09 19:22:12
问题 I can't find any documentation which explains if and how to modify the expiry time of access and identity tokens for AWS Cognito User Pools. The documentation specifies that by default expires 1h after the emission. Is there a way to modify the expiry time? 回答1: This is currently not possible to configure for your user pool. They are set to one hour for everyone. 回答2: I presume the question is how to get get granular control of Cognito session termination. There is a way to do this. But first

AWS: specify Lambda version for Cognito trigger

大城市里の小女人 提交于 2020-05-02 04:05:14
问题 I have a Cognito User Pool and corresponding a Identity pool. I want to call a specific version of my Lambda function on Post authentication or some other trigger like that. I don't see an option to specify a version code in the Console although the examples all have a version number. http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html { "version": number, "triggerSource": "string", "region": AWSRegion, "userPoolId":

(Where to) Create AWS CognitoUserPool in an Angular 8 application

[亡魂溺海] 提交于 2020-04-17 20:24:08
问题 From the AWS Cognito documents: https://aws.amazon.com/blogs/mobile/accessing-your-user-pools-using-the-amazon-cognito-identity-sdk-for-javascript/ AWSCognito.config.region = 'us-east-1'; var poolData = { UserPoolId : '...', // your user pool id here ClientId : '...' // your client id here }; var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData); var userData = { Username : '...', // your username here Pool : userPool }; However I do not know which file /