I have an API resource that is working as expected as you can see from the screen-shot below.
But when I deploy and access it through URL something like this...
https://vatultwgoc.execute-api.us-east-1.amazonaws.com/staging/oksoft?url=http://google.com
I get an error:
{"message":"Missing Authentication Token"}
What is the correct way to deploy API ?
Please make sure you invoke your API with the correct http method. I just try to invoke your API, and I am getting "null" which matches your test invoke result.
Related
I am trying to build realtime chat and notification using AWS Websocket API. i have setup the $connect route to integrate to http endpoint. when testing the websocket URL using wscat, request successfully received on my endpoint, but wscat got "Unexpected server response: 500". inspecting associated log on CloudWatch, i found an error said "Output mapping refers to an invalid method response: 200". anyone can please help me to figure out what am i doing wrong here?
This stems from a missing Method Response on the method.
Select the API Gateway Method
Select Method Response
Ensure that a mapping exists for a 200 response (either 200 or 2**)
For me the problem was that despite having configured the response routes correctly with a $default response (as a catchall), the deployment did not contain these integration responses.
This was due to the deployment resource being created before the actual routes. I solved it by adding making the stage DependsOn the route, and the deployment DependsOn the stage (this I did by using an implicit dependsOn via a StageResource.ref for the stageName attribute on the deployment).
You can check out my answer here for more details.
In the Keycloak documentation the base path is defined as: localhost:8080/auth
But if we try to reach the documented endpoints we always get a Not Found response.
We get a 404 if we try to access the endpoint to get the top-level representation of the master realm: GET /{realm} like:
http://localhost:8080/auth/master
But if we try it like:
http://localhost:8080/auth/admin/realms/master
we receive a successful response.
Are we overlooking something or is this an error in the documentation?
It seems an HTTP response of 403 is accepted as the norm and correct handling of any calls made to a resource or endpoint that does not exist on an API Gateway setup (this post).
Example: a call to a non-existing endpoint on my Gateway would be;
GET -- https://{{MyGatewayDomain}}/api/v1/blah
This would return a 403 forbidden. Which can be rather confusing and misleading.
I'd like to know if anyone has managed to configure their API Gateway so that any call to a non-existing endpoint / resource, returns what I would have thought is a correct response of a 404?
Thanks in advance.
EDIT
As per bejos-aws's suggestion, I am able to override the default behaviour of the 403 Missing Authentication Token however, this will not solve my issue as then all the valid 403 errors would return a 404 response which is incorrect.
Also, my issue is regarding a 403 forbidden which doesn't exist in the default responses in the AWS Gateway Response's list (and even if it did, that wouldn't help).
Seems this is just not possible?
This is not currently a feature of API Gateway. However, there is a workaround. Using Gateway Responses, you can override the 403 Missing Authentication Token response with a 404 and supply whatever message you want as a response.
Note, this only works when the API stage is valid:
So if your API is deployed to a stage named v1
https://{MyGatewayDomain}/api/v1/somepath
And the caller supplies the wrong stage
https://{MyGatewayDomain}/api/invalidStage/somepath
Then the API will still respond with 403 Forbidden
Does Camel-Http4 supports Basic Authentication?
Followed this and other posts
Camel http4 download file using Basic authentication over Https
I am using camel 2.17.3 version. using camel-http4 component. The route sends a https4 multipart request to a REST endpoint . The REST service is behind the siteminder. Have truststore/ketstore/cert all setup and it works fine, just sending basic auth is causing trouble.
Using postman i was able to call REST services with basic auth. However, all the calls from camel route fails and get HTTP error 403.
I tried below options to get it working:
Added basic auth to the HttpConfiguration - got HTTP error 401
Added "Authorization" header to the route, as mentioned in the above link - got HTTP error 403
and Added method,user,pass to HTTP_Query - 403 also clear text password is visible in the siteminder logs, this is not good, so dropped trying this option.
please help resolve this issue with some working example and explain the cause.
Is camel dropping http headers?
also i now thinking should I consider using other available components netty/jetty/cxf?? But I prefer getting HTTPs4 working :)
thanks
To help others with an working example, here is how I got it...
1) Check the site-minder policy and also ensure the user have correct permissions for the services.
2) Passing user/password as query parameter isn't safe (at least it wasn't in my case) Clear text password was exposed in site-minder.
3) setting header (Authorization)
apache-camel-basic-http-auth
Is this “Get Package” API still supported:
http://msdn.microsoft.com/en-us/library/windowsazure/jj154121.aspx
Seems like it always return HTTP 404.
I’m able to successfully use the “Get Deployment” API documented here:
http://msdn.microsoft.com/en-us/library/windowsazure/ee460804.aspx
But can’t get the /package resource to work. Note that I'm using the same certificate for authentication that I use for the "Get Deployment" API, and it works fine.
My call to the API looks exactly like in the MSDN documentation.
Is there any other way to retrieve the Service Package (.cspkg) file of a deployed cloud service?
The Get Package operation is still supported. It's likely that if you're getting a 404 response that you're using a HTTP GET method as opposed to POST. I've tested the operation using the REST Console plugin for Chrome and my package was successfully written to blob storage.
The URI used was:
https://management.core.windows.net/<subscription-id>/services/hostedservices/<cloudservice-name>/deploymentslots/<deployment-slot>/package?containerUri=<container-uri>