passport-facebook Failed to obtain access token - node.js

I am trying to register my users with Facebook using passport-facebook#1.0.3 following this example. My problem is that when the user is authenticated the response is:
Failed to obtain access token
Error: getaddrinfo ENOTFOUND at
Strategy.OAuth2Strategy._createOAuthError
/home/sigfried/github/passport-social/node_modules/passport-facebook/node_modules/passport-oauth2/lib/strategy.js:348:17)
I've checked my Express routes and everything seems to be fine. I checked the Network methods with Firefox and when the response come back to my server I've noticed an 500 Internal Server Error with this address: http://localhost:3000/login/facebook/callback?code=L4rg3H4sh#_=_

check whether your ssl connection is blocking this..

Most likely I was trying to access an address in my localhost, so I think that the solution here would be to expose, with something like ngrok, my local server and then problem solved.
Hope this helps someone in a hurry or as naive as I was.

Related

ENOTFOUND as API response

#NeedHelp
Has anyone faced the below issue while hitting an API? I guess it is something related to system configuration and not related to API. As others can fetch response from this.
But in my case, the api gives response sometimes and sometimes it throws below error:
getaddrinfo ENOTFOUND
Is it something related to localhost.
I'm using a mac machine.
Please help If you have any idea on this?

An Error occured while making HTTP Request from POSTMAN

This Error Occurs While I am trying to make any HTTP request to my REST API on Azure server from POSTMAN.
Why is this occurs ?
Might be your machine was started but you forgot to start the Azure server. I once faced the same problem, it occurs because my server was not properly started
This error occurs due to the tcp/ip request. This indicates whether you have not started your virtual machine or you your api needs a token to access

connect hostinger DB with nodejs in local

I have created a database in Hostinger and make it remote. But, when I try to connect with my local using nodejs I am getting an error: "ER_ACCESS_DENIED_ERROR" even after using the right username and password.
This is my code below:
Have I done anything wrong? Please help me
This error usually occurs if the credentials are incorrect or the user can not access the database.
Also, In an express app, it is usually better to re-use the database connection instead of connecting to the database on every request.

Docusign Connection issue

We are using the Docusign Rest API to integrate with our application to send documents for signing.
The below mentioned is the connection string that is formed during runtime
Connection String =
weblogic.net.http.SOAPHttpsURLConnection:https://demo.docusign.net/restapi/v2/login_information
When we try to get response from the connection, we get the following error
java.net.ConnectException: Tried all: 1 addresses, but could not connect over
HTTPS to server: demo.docusign.net port: 443;
Any pointers in this regard would be highly appreciated.
Thanks
Rashmi
Your error message is coming from the weblogic stack. Therefore, things to try:
Ensure that your server has Internet connectivity to https://demo.docusign.net by pinging from the console.
Check for https connectivity by using curl or similar.
Check that you're using the right method from your stack for https connections.
Since https://demo.docusign.net is definitely up and working (try it from a browser) the problem is local. Consult your stack vendor for additional help.

How to send access token using a wss .net client

I want to connect to the nest endpoint using a .net wss client.
I am unsure how to pass the NEST access_token during handshake to the endpoint to complete
the authorization handshake.
Without it I get a 401.
If I put is as query parameter "/devices.json?auth=c.Uysdi..." I get
a 307 (redirection) to a firebase endpoint but with https ??? (no
longer wss).
If i add the access token to headers I get 401.
In the api samples I can only find javascript examples using firebase client lib which
does not help much.
Can someone explain what should I do to complete the wss handshake ?
I replaced the https with wss. that worked for me.
Maybe a bit of code will help people solve you issue
I found out what was the problem.
There was a 'bug' in the web socket library I was using. The header value "Upgrade: websocket"
which is passed during websocket handshake was passed like this "Upgrade: webSocket".
Some websocket test servers are case insensitive but not the one from Google Nest.
Once I changed this to "websocket" I got a proper websocket handshake response and no redirection either.
Access token is added as a query parameter when connecting with websockets to the nest endpoint.
Once the connection is established I am again in the dark on how to establish subscribtion to certain
events or query data but this will be the topic for another question.

Resources