aws-api-gateway

How to access the raw query string (or full URL) in a Chalice (AWS Lambda/API Gateway) app?

烈酒焚心 提交于 2021-02-19 06:01:34
问题 I'm using Chalice to build a fairly straightforward API on AWS Lambda & API Gateway. I need a way to get access to the raw query string (i.e foo=bar&abc=123 ). When accessing the app.current_request.query_params dictionary, it's already been processed, such that any empty parameters ( foo=&bar= ) have been stripped out. Unfortunately I'm working with a third-party API that sends a signed hash value in the query string, based off the raw query string. I can't verify it without the original,

How to use multiple Cognito user pools for a single endpoint with AWS API Gateway?

空扰寡人 提交于 2021-02-19 03:41:54
问题 I've recently implemented an API Gateway as a proxy with a single proxy endpoint. I'm using Cognito as authorisation mechanism and as long as I have only one user pool everything is fine. What I am trying to achieve is to be able to allow users from different user pools, but in the AWS Console I just seem to be able to select one Cognito mechanism which is only one user pool. Is there a way to allow multiple user pool through another mean ? Is there an alternative best practice for this

API gateway Cognito user pool authorizer - 401 unauthorized

喜夏-厌秋 提交于 2021-02-18 05:34:45
问题 I was trying to get my API gateway work with Cognito user pools authorizer but I cannot seem to get it to work. I am not using any SDK as of now. Some details - for Cognito pool, I have setup ID provider as cognito user pool, Oauth flow 'impilicit grant' & scope as 'openid'. Created an app (& domain) with client secret also generated. Email is the only field. - on API gateway I added the same user pool for cognito auth & header as 'Authorization'. No scope was added and no token validation. I

API Gateway POST method working during tests, but not with postman

百般思念 提交于 2021-02-18 02:31:54
问题 i will try to explain my problem clearly. I have an API who writes something in DynamoDB with a lambda function written in Node.js. When i'm calling it within the AWS console, the API works as expected. I send a body like that: { "user-id":"4dz545zd", "name":"Bush", "firstname":"Gerard", } And that creates the entry within my dynamoDB table. But when i call the same API (freshly deployed) with Postman, i get this error: { "statusCode": "400", "body": "One or more parameter values were invalid

API Gateway POST method working during tests, but not with postman

核能气质少年 提交于 2021-02-18 02:29:50
问题 i will try to explain my problem clearly. I have an API who writes something in DynamoDB with a lambda function written in Node.js. When i'm calling it within the AWS console, the API works as expected. I send a body like that: { "user-id":"4dz545zd", "name":"Bush", "firstname":"Gerard", } And that creates the entry within my dynamoDB table. But when i call the same API (freshly deployed) with Postman, i get this error: { "statusCode": "400", "body": "One or more parameter values were invalid

API Gateway custom domain certificate error

£可爱£侵袭症+ 提交于 2021-02-16 16:08:28
问题 I'm trying to set up a regional API gateway with a custom domain, and I'm hitting a problem involving SSL certificates. Here's what I've done: Using ACM, created a certificate for vitalservices-3.docriot.com. In API Gateway, created a regional custom domain name--vitalservices-3.docriot.com--assigned the vitalservices-3.docriot.com certificate to it, and added a base path mapping from "/" to "vitalservices-3:prod". In the Route53 hosted zone for docriot.com, created a CNAME record mapping

AWS API Gateway with Custom Authorizer and CORS Intermittent 200 then 403 then 200 … Strange

回眸只為那壹抹淺笑 提交于 2021-02-16 14:48:11
问题 I have an 1 Amazon Api Gateway setup with a custom authorizer (the authorizer basically just returns allow for anything) I enabled CORS, and this is running from jQuery webpage. I have two method /vehicles (returns a list of car) /bookings (returns booking details) The behavior I am seeing, is the first request goes fine, I see it pull the OPTIONS , then perform a GET request. Then , I hit the other method the OPTIONS works, then the get returns a 403 , but if I launch the request again ( On

How to workaround custom domain for private API gateway?

梦想与她 提交于 2021-02-16 04:51:52
问题 I know that custom domain names are not supported for private APIs. Also, similar question was answered here. Unlike the problem of ugly url as in question above, my problem is with format of private dns, which is as follows: https://{restapi-id}.execute-api.{region}.amazonaws.com/{stage} The problem is that hostname is dynamic - RestapiId can change whenever CloudFormation stack is recreated. This recreation is done when CF stack is in rollback_complete state and can not be updated. Then I

How to workaround custom domain for private API gateway?

心不动则不痛 提交于 2021-02-16 04:51:35
问题 I know that custom domain names are not supported for private APIs. Also, similar question was answered here. Unlike the problem of ugly url as in question above, my problem is with format of private dns, which is as follows: https://{restapi-id}.execute-api.{region}.amazonaws.com/{stage} The problem is that hostname is dynamic - RestapiId can change whenever CloudFormation stack is recreated. This recreation is done when CF stack is in rollback_complete state and can not be updated. Then I

AWS Cognito user able to sign in, but API “Does not exist” when using I can access using access token on console?

前提是你 提交于 2021-02-11 12:50:20
问题 Im a bit lost here and would love some help. I am trying to connect my React Native app to a basic Lambda function. I have no bother Registering a user, Confirming a user or Signing in. I can see all of these things in the Cognito Console. I also am able to test the access to the API with the Authorizers part of the API Gateway and get a Response Code: 200 with the correct email from cognito. Here is the code: async signIn(email: string, password: string) { try { //sign in the user const user