loopback-component-passport | LoopBack passport integration to support | Web Framework library
kandi X-RAY | loopback-component-passport Summary
kandi X-RAY | loopback-component-passport Summary
The module provides integration between LoopBack and Passport to support third-party login and account linking for LoopBack applications. Please see the official documentation for more information.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of loopback-component-passport
loopback-component-passport Key Features
loopback-component-passport Examples and Code Snippets
Community Discussions
Trending Discussions on loopback-component-passport
QUESTION
I am trying to upgrade from loopback 3 to loopback 4 using "mounting strategy" according to the documentation.
while trying to run the app using npm start, i am getting the following error:
node -r source-map-support/register .
Cannot start the application. { Error: Cannot find module '../../node_modules/loopback-component-passport/lib/models/utils.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (C:\Data\myComp\app\myapp_docker\services\myapp_auth\lb3app\server\utils\providerUtils.js:2:15) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (C:\Data\myComp\app\myapp_docker\services\fauth\lb3app\server\server.js:6:25) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) code: 'MODULE_NOT_FOUND' } npm ERR! code ELIFECYCLE npm ERR! errno 1
I checked and i have the module in the node_modules directory and the utils.js file.
...ANSWER
Answered 2019-Sep-23 at 12:40I had to search in all my app files for the string "node_modules" and I found that the relative path for that directory was incorrect. had to add one more "../" before the node_modules.
QUESTION
I'm using passport to authenticate users for my application using Facebook. In my application, I have 2 different users: customers and professionals (transitioning to "experts").
I followed the Loopback docs to implement the loopback-component-passport package and passport-facebook and have it working for my customers.
Because I use custom User models, I followed this SO Post on how to get that fixed (note: I still use the build-in AccessToken model).
Angular FrontendI use an Angular frontend. To redirect the user back to my frontend, I created a bootscript that looks like this:
...ANSWER
Answered 2019-Jun-17 at 10:33So I was able to fix this by using the PassPortConfigurator#configureProvider
method. Instead of using the JSON files to setup the facebook authentication, I did it in JS.
QUESTION
I have created Loopback app and am using loopback-component-passport to authorize against Google Oauth2. Issue I am having is that when I log in (using login dialog from google) and then logout (using api/Users/logout url and clearing cookies) and then trying to login again, I get authenticated with my last credentials (no google dialog loaded and new access_token is generated). I do not have a chance to type another credentials (unless I open the site in new incognito window or with guest browser user).
I can't find where is something cached so google generates access_token assuming my username. Under what circumstances does google assume what is my username?
...ANSWER
Answered 2018-Jun-17 at 06:46Adding
QUESTION
I am using a loopback-component-passport to authenticate users via google OAuth2Strategy. Everything works well except passing the "hd" or "hostedDomain" param to google.
My provider.json looks like this:
...ANSWER
Answered 2018-Apr-12 at 16:11Try adding:
QUESTION
I am trying to get Facebook login working with loopback using their loopback-component-passport plugin.
I have configured app details in providers.json and now if I visit http://localhost:3000/auth/facebook I am redirected to facebook and can successfully login. However, when I get redirected back (to /auth/facebook/callback) I get the following error --
ValidationError
422 The 'ApplicationCredential' instance is not valid. Details:
providercan't be blank (value: undefined).
I can't make sense of this error because the providers file is where the fb app and paths etc are configured and they are definitely working.
The plugin is poorly documented so I am out of ideas at this point.
...ANSWER
Answered 2017-Sep-10 at 05:59I have figured out the cause for this error. I had initiated my loopback project as a blank project. However for loopback-component-passport
to work it requires User, AccessToken, ACL models to be available. These are inbuilt in loopback and can be manually added to model-config.json
. Or, you can initialize the project with user authentication and it should work.
This was one of many roadblocks that I ran into due to my lack of knowledge in the area and Loopback's poor documentation for the plugin. The Tutorial section in the docs and the example github project it links to are completely out of date.
QUESTION
I'm trying to use a extended loopback user model together with the loopback-component-passport for facebook login. The login itself is working but i can't get it to use my custom user model instead of the builtin "Users".
steps i took:
- create custom user model with slc loopback:model extending "User"
...ANSWER
Answered 2017-Mar-01 at 14:20You will have to extend all passport related models, so you can have them linked to your custom user model.
user.json
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install loopback-component-passport
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page