Pomax / node-flickrapi

A node.js (and client-library) implementation of the Flickr API with oauth API key authentication and API method proxying

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple user authentication

opened this issue · comments

I am trying to work out a way to enable multiple user login so that I can use this library as a server component on a public website. I want individual Flickr users to be able to use the website I am building.

At the moment the access token and secret are stored in the server .env file. I was thinking about making a modification to store the token and secret in a cookie but:
(a) I am new to node so not 100% sure where to start, was thinking about adding an additional option to allow the option to save in either the .env or a cookie.
(b) Wanted to double check that I am not misreading things and there is actually a way to do this today.

Make sense?

commented

Do this the right way: use one instance per user, because credentials should not be shared:

users.forEach(user => {
  Flickr.authorize(user.options, (err, flickr) => {
    if (err) {
      return ...;
    }
     // and have this kick off that user's "whatever happens" code:
    user.setFlickrAPI(flickr);
  });
});

Hi there, I have done a load of research and have found a library called Grant that does the oauth the way I need it to work for my website. Thanks for the help.

commented

depending on the additionals, a fair number of the modules on https://www.npmjs.com/search?q=oauth will work quite well (some more maintained than others) but if you found one that works for you: great!