Search code examples
node.jsauthenticationpassport.jseveryauth

User Permission Level in Passport


Any tutorials on using the Dynamic scope and permissions of the Passport authentication library for Node.

Did not find any in the documentation.

How do we set the user type for the authenticated user?

Is it easier to do in everyauth?


Solution

  • You can find an example in the Facebook section of the guide: http://passportjs.org/guide/facebook/

    app.get('/auth/facebook',
      passport.authenticate('facebook', { scope: ['read_stream', 'publish_actions'] })
    );
    

    Based on your question, I'm not entirely sure that's the info you're looking for. If you want to make authorization/access control decisions based on your user module, that'll need to be handled by a different library in combination with Passport (which is authentication only).