Giter VIP home page Giter VIP logo

Comments (6)

SebastianMetzger avatar SebastianMetzger commented on August 19, 2024

I believe I just solved the issue ...

In server.js the examples call the loopback 'boot' functions before passport is initialized, if you change the order to the following, the requests inside loopback are also authenticated:

passportConfigurator.init();

boot(app, __dirname);
app.use(loopback.cookieParser(app.get('cookieSecret')));

I also had to move the cookieParser midleware with the boot function to make this work.

from loopback-component-passport.

SebastianMetzger avatar SebastianMetzger commented on August 19, 2024

Another addition:
Changing the initialization order enabled me to access the user object from inside loopback, but it is not caught, when setting up acl rules for the models

from loopback-component-passport.

raymondfeng avatar raymondfeng commented on August 19, 2024

Is your app based on https://github.com/strongloop/loopback-example-passport? If so, we should consider to upgrade the app using phase to order the middleware as described http://docs.strongloop.com/display/LB/Defining+middleware.

from loopback-component-passport.

SebastianMetzger avatar SebastianMetzger commented on August 19, 2024

Yes we took that example as a blueprint

from loopback-component-passport.

superkhau avatar superkhau commented on August 19, 2024

@SebastianMetzger Is this resolved? Can I close this?

from loopback-component-passport.

loay avatar loay commented on August 19, 2024

Closing due to inactivity. If you are still running into problems, feel free to leave a comment and I will reopen the issue.Thanks.

from loopback-component-passport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.