Validate credentials using OAuth - node.js

Im trying the run the code from node examples/simple_express3.js which is given in the link at my project at Github.
Can anyone explain me what http://localhost:8081/secret is trying to do?
How can I connect to my own Authentication server when the client is accessing http://localhost:8081/login

Related

SwagQL - Unable to verify the first certificate

I followed the instructions in https://medium.com/groupon-eng/swagql-582df83f7d19 and was able to generate a GraphQL schema from my Swagger documentation, start an Express node.js server and open GraphiQL locally on my browser.
The problem is, when I try to query any of my endpoints I keep getting the following error:
unable to verify the first certificate
Is there a simple way I can pass my api_key into GraphQL so that my queries are authenticated correctly?
To anyone having the same problem, I was able to bypass the error message by issuing a provider certificate and associating it to my site's binding in iis, then using the new qualified hostname as the Gofer baseUrl in the node.js client app.

How to get OAuth2 token from an EC2 instance with no browser using nodejs google api

I have a node.js app that uses the google drive API to upload a file to a google drive. It is working fine on my local machine. I am now trying to migrate it to an EC2 instance but when I run the app using node, I am unable to verify by visiting the url...
Authorize this app by visiting this url: https://accounts.google.com/o/oauth2/v2/auth?>access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&response_type=code&cl>ient_id=xxxxxxxxxxxx.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoo>b
Not sure how to proceed as there is no browser on the machine - which makes me question if I am using the correct protocol for this application? I get totally confused by all the different options available.
I am basically using the option laid out here: https://developers.google.com/docs/api/quickstart/nodejs
Any pointers would be greatly appreciated.
Following the steps from the NodeJs Drive API quickstart, you can run your application locally the first time, this way the consent screen will be prompted and you'll be able to grant the permissions. With this, a token.json file will be created in your directory which will be used to create refresh tokens used to authorize the subsequent requests. You can upload your application to the EC2 instance with the token.json file included and you won't have to authorize the application again.
You can read more about refreshing an access token with offline access in Google's OAuth documentation.

oauth2 server creation Nodejs

I'm trying to implement an OAUTH2 server in nodeJS, which allows client app to login users using my website(like login with google).
I tried using oauth2orise(https://www.npmjs.com/package/oauth2orize) and referred few links:-
https://hnryjms.io/2014/07/oauth2/
http://scottksmith.com/blog/2014/07/02/beer-locker-building-a-restful-api-with-node-oauth2-server/
but still I'm not being able to understand how methods are getting invoked and how exactly I should Implement the flow.
So if anyone could explain how to implement that would be helpful.
Thanks in Advance.

Using Twitter for user authentication in Heroku: "can’t establish a connection to the server at 127.0.0.1:8080"

I am following this scotch.io tutorial on twitter node authentication to authenticate users on a Heroku app. I have made my callback URL this: http://127.0.0.1:8080/auth/twitter/callback
I am able to click on a link to authenticate the user but then and it says "can’t establish a connection to the server at 127.0.0.1:8080"
No useful clues in the logs. I believe I have set up all my routes and .js files properly, as laid out in the tutorial, and am not sure what could be causing this problem.

Phonegap Facebook authentice in server side using expressjs and passportjs

I built a web server using nodejs and expressjs where authentication is done using passportjs.
I now want to build a mobile application using phonegap and of course use my existing web server to query for data.
I need to authenticate my users using Facebook connect on my server and only then the session is created and I can query my API.
I searched a lot for a solution and found nothing. I looked at InAppBrowser and ChildBrowser but I don't think they will do the trick as I need to keep the session alive in order to query the api.
Any help would be appreciated
Thanks

Resources