Trying to authenticate to grafana with http api - grafana

I'm trying to make an http request with my web app but I see unauthorized response. If I use curl in command line I see a response: curl http://api_key:KEY#MyGrafana:3000/api/org. My problem is that when I try to access grafana using the same url in the browser I'm getting unauthorized. Any idea why is happening this?

Related

Custom endpoint path for AWS API Gateway WebSocket

I have created an API Gateway with Websocket protocol.
After I deploy the API, I get a WebSocket URL and a connection URL.
e.g.
WebSocket URL: wss://xxxx.execute-api.us-west-2.amazonaws.com/test
Connection URL: https://xxxx.execute-api.us-west-2.amazonaws.com/test/#connections
Now everything is fine, I am able to connect to the API, and send and receive messages.
But when I try to access a different path, I get an HTTP 403 error.
e.g. If I try to connect to wss://xxxx.execute-api.us-west-2.amazonaws.com/test/some/path
, I get 403 error.
Is it possible to configure API gateway in such a way that it accepts connections to all paths and passes on the path, i.e. /some/path in my case, to the $connect route handler?
This is not yet supported by AWS. See the article and comments here https://medium.com/#lancers/using-parameter-mapping-in-websocket-api-67b414376d5e
There is a workaround with using an additional server, author of the article proposes the following:
you may put your own server that accepts an URI with path parameters, then return 302 to redirect the client to the WebSocket API endpoint with query string instead.

RESTful API for WSO2 API Manager 2.6.0 does not work in POSTMAN

I'm trying RESTful API for WSO2 API Manager 2.6.0 with POSTMAN. The documentation is here. I use POSTMAN instead of directly using curl commands. After importing curl command and setting request body, when I click Send button POSTMAN gives this error. However, curl works fine in the terminal. Can anyone help with this issue?
This issue is due to SSL certificates are being blocked as mentioned in reasons. Go to File->Settings->General and turn off SSL certificate verification in POSTMAN.

Openfire Rest API plugin field Authorization

I have a problem. I'm trying to get access to Openfire Rest API plugin via https in this way:
https://my-openfire.org.ua:7443/http-bind/plugins/restapi/v1/chatrooms
And I get error:
Failed to load https://my-openfire.org.ua:7443/http-bind/plugins/restapi/v1/chatrooms: Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response.
People, what am I doing wrong?
you need to use the path: https://myopenfire.org.ua:9090/plugins/restapi/v1/chatrooms
(It uses the web interface port) and it's not binded to "http-bind"

Parse-Server Rest API HTTP Authentication

I can not get the Rest API to work with Basic Authentication like in the guide i.e. https://myAppID:javascript-key=myJavaScriptKey#api.parse.com/1/classes/GameScore/Ed1nuqPvcm.
I can make it work if I use curl and pass the keys via HTTP Headers, however I'm trying to use a WebHook from another service and I don't have the ability to send HTTP headers.
2 issues when trying locally:
http(s) does not work even locally.
http gives me error:unauthorized.
I'm using parse-server installed via npm globally but don't see a place to add cert.
Please help!
I was able to use http local and remote using the format http://myAppId:myMasterKey#mydomain.com:1337/parse/classes/myClass and it worked fine. If you use Postman you have to turn on Basic Auth in the header section.

cURL follow redirect without headers from original request

I'm trying to download the bits of a Cloud Foundry app using the Cloud Foundry API.
https://apidocs.cloudfoundry.org/236/apps/downloads_the_bits_for_an_app.html
When using a remote blobstore, such as AWS, the response is a redirect to the actual location of the bits. If the client is automatically following redirects, then the OAuth token that was used to communicate with Cloud Controller will be replayed on the new redirect request. Some blobstores may reject the request in that case. Clients may need to follow the redirect without including the OAuth token.
Here is my cURL command I'm attempting to use:
$ curl -L "https://api.my.host.net/v2/apps/my_app_guid/download" -X GET -H "Authorization: bearer myauthtoken"
curl: (7) Failed to connect to dal05.objectstorage.service.networklayer.com port 443: Operation timed out
I'm assuming my issue is that my Auth header bearer token is being sent on the redirect based on the quote from the Cloud Foundry API docs. How can I follow the redirect without the OAuth token? I'm using the default cURL command line utility on Mac OS X 10.11.
While #DanielStenberg's comment appears to be correct that the header wasn't my issue, I'll go ahead and provide an answer to my original question.
It appears the only way to follow the redirect without headers would be to NOT immediately follow the redirect, but print the response headers with the curl -D - command option. Once you get the 301/302 response from the original request, check the location header value that came in the response headers, then execute another curl to that location.