strongloop / loopback-component-oauth2

oAuth 2.0 server for LoopBack
http://www.strongloop.com
Other
62 stars 63 forks source link

Not apply to every rest api #70

Closed rahulkulmi closed 7 years ago

rahulkulmi commented 7 years ago

Hi, I am using "loopback-component-oauth2": "3.0.0" i have apply in my loopback application in server.js file but it will not apply validate ever rest api root path so please clear the steps if i am miss some thing because in loopback documentation some thing is missing.

My code is below so please let me know what i am missing i have create new user and also that user is available in my database so what is missing.

boot(app, __dirname, function(err) {
  if (err) throw err;

  var options = {
    dataSource: app.dataSources.mydb,
    resourceServer: true,
    authorizationServer: true,
    loginPage: '/login',
    loginPath: '/login',
  };

  oauth2.oAuth2Provider(
    app, // The app instance
    options // The options
  );

  oauth2.authenticate(
    ['/protected', '/api', '/me'],
    {session: false, scope: 'email'}
  );

  // start the server if `$ node server.js`
  if (require.main === module)
    app.start();
});
stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 7 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.