Giter VIP home page Giter VIP logo

Comments (6)

raymondfeng avatar raymondfeng commented on August 19, 2024

You probably call the following line too late:

passportConfigurator.init();

from loopback-component-passport.

gabrielciulei avatar gabrielciulei commented on August 19, 2024

It works. I had to call it before boot function.
Thank you very much.

from loopback-component-passport.

gausie avatar gausie commented on August 19, 2024

I also have this problem. However, I need to call it after the boot function so that the config is loaded into app (so I can do things like app.get('sessionSecret'))

from loopback-component-passport.

gianko avatar gianko commented on August 19, 2024

I have a problem when using:

app.middleware('auth', loopback.token({
  model: app.models.AccessToken
}));

Then context.active gets empty in:

var context = loopback.getCurrentContext();

from loopback-component-passport.

superkhau avatar superkhau commented on August 19, 2024

@gausie Doing it after boot makes sense if you want to make sure the default LB ocnfigs are loaded first.
@gausie Please post questions at https://groups.google.com/forum/#!forum/loopbackjs. See https://github.com/strongloop/loopback/wiki/Reporting-issues#question for more details.

Closing as this is resolved by @raymondfeng.

from loopback-component-passport.

mike-aungsan avatar mike-aungsan commented on August 19, 2024

@raymondfeng
I have the same problem no matter where I put this line before or after boot.
passportConfigurator.init()

So finally I did like this
app.middleware('session:before', loopback.cookieParser(crypto.randomBytes(64).toString('base64')))

Interesting thing is that example code work fine. But I use all the latest version in my package.json which probably make it not work.

And I know it is not a good place to ask but since I got no response anywhere,

Why is this component not pure REST API?
I want to see token response from this login API.
http://localhost/auth/local

{
"dependencies": {

"compression": "^1.0.3",
"cors": "^2.5.2",
"loopback": "^2.22.0",
"loopback-boot": "^2.6.5",
"loopback-component-explorer": "^2.1.0",
"loopback-datasource-juggler": "^2.39.0",
"serve-favicon": "^2.0.1",

"ldapjs": "mcavage/node-ldapjs#acc1ca8f4314fd9d67561feabc8ce4c235076a5e",
"ldapauth-fork": "latest",

"mongodb": "latest",

"body-parser": "latest",
"express-flash": "latest",
"express-session": "latest",
"cookie-parser": "latest",
"connect-ensure-login": "latest",

"passport": "latest",
"passport-ldapauth": "latest",

"loopback-connector-mongodb": "latest",
"loopback-component-passport": "latest",
"loopback-component-storage": "latest"

}
}

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.