Skip to content
LoopBack passport integration to support third party logins and account linking
JavaScript
Find file
Latest commit e384466 Raymond Feng 2.1.0
 * Update deps (Raymond Feng)
 * Fix email validation for LDAP issue 1963 (Loay Gewily)
 * Fix getting AuthStrategy directly from package when Strategy key is not here (Steve Grosbois)
 * Make `username` field optional in UserIdentity.login method (Vladimir Shushkov)
 * Throw softer error in `local` stragegy when trying to create `accessToken` with `"setAccessToken": true` option. In case when reason is wrong user password. (Vladimir Shushkov)
 * The name of provider can be configured in options. (Clark Wang)
 * Avoid duplicate user identities (Clark Wang)

README.md

loopback-component-passport

NOTE: This module supersedes loopback-passport. Please update your package.json accordingly.

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.

All local accounts requires verification

All third party accounts will login with an email of uniqueID@loopback.provider.com example 123456@loopback.facebook.com

which will allow the user to link the social media accounts that they want as well as the users could sign up with the same email account that is used for facebook/twitter/google/local if they wish to keep them separate.

If more info is required from the Facebook profile such as email, it could still be obtained. In node_modules\passport-facebook\lib\strategy.js, replace:

this._profileURL = options.profileURL || 'https://graph.facebook.com/me';

with

this._profileURL = options.profileURL ||
    'https://graph.facebook.com/v2.2/me?fields=first_name,gender,last_name,link,locale,name,timezone,verified,email,updated_time';

All user required info including the email will be available, but the main email for the account will remain uniqueID@loopback.facebook.com.

Something went wrong with that request. Please try again.