Phonegap Facebook authentice in server side using expressjs and passportjs - node.js

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

Related

Google 2 Factor Authentication with Angular and NodeJS

I am looking for API and Example that can help me to build two-factor authentication of my website for the server as well as the front side.
I want to build something like this, http://ngtfaweb.azurewebsites.net/#/home
You could use Passport Js if you are using node js as backend or you could use services like Auth0 which are one step solution for multiple Oauth.

Passing Bluemix APP-ID authentication from Node.js to Angular5

I'm working on a project that uses Bluemixes APP-ID for authentication and are using Node.js for our backend. What I want to do is to be able to login with the App-ID authentication (that uses passport.js) and use this token in my Angular5 project and from there be able to store new user-specific attributes.
What is the proper way of doing this?
Thankful for any answers :)
After some research, it seems like the way forward is to create an endpoint in the Node.js that one then uses with the angular project. Just make sure the endpoint also is protected by the webAppStrategy if using that.

How to authenticate google api to insert calendar events - NodeJs

How can I authenticate my api access to insert new events to my google calendar without OAuth? I'm writing a node script without any front end/website and everywhere seems to recommend using OAuth with a redirect to your website...
The best solution I have come up with is write a secondary application purely to listen for that redirect and save the auth code returned.
Any suggestions would be greatly appreciated!
I think it was designed that OAuth be used to handle authentication and authorization when you're using Google APIs. You can read that from the Using OAuth 2.0 to Access Google APIs.
Google APIs use the OAuth 2.0 protocol for authentication and
authorization. Google supports common OAuth 2.0 scenarios such as
those for web server, installed, and client-side applications.
If you're using NodeJS for Calendar API, you can try the Node.js Quickstart. You'll be needing the following:
Node.js installed.
The npm package management tool (comes with Node.js).
Access to the internet and a web browser.
A Google account with Google Calendar enabled.

Finding 2nd and 3rd level connection using Facebook

I am developing a webapp and one of the functionalities is the way how linkedin connections work.
For a given 2 users, we show the path of connections for 3 levels.Is there a way this could be achieved using Facebook API.
I am allowing user to login using facebook credentails and saving the tokens in MongoDB.I used node js for server side processing.
Any help is appreciated.
No, this is not possible via the Graph API. You can only get those friends which are also using your app, not all friends (if your app is >=v2.0).

NodeJS API - security issues

I am making an API in NodeJS that 'll be used by a website and iPhone native app at the same time.
There is a chance that API URL will be exposed to user when used in javascript for website. I only want authorized access to the API. Don't want anyone call API via console. like user/delete/[user-id], anyone can use this URL to delete a user.
Check out http://passportjs.org/
There are plenty of authentication strategies to use. Don't reinvent the wheel here. ;)

Resources