Tracks third-party logins and profiles.
Name | Type | Description |
---|---|---|
provider |
String
|
Auth provider name, such as facebook, google, twitter, linkedin. |
authScheme |
String
|
Auth scheme, such as oAuth, oAuth 2.0, OpenID, OpenID Connect. |
externalId |
String
|
Provider specific user ID. |
profile |
Object
|
User profile, see http://passportjs.org/guide/profile. |
credentials |
Object
|
Credentials. Actual properties depend on the auth scheme being used:
|
userId |
|
The LoopBack user ID. |
created |
Date
|
The created date |
modified |
Date
|
The last modified date |
Log in with a third-party provider such as Facebook or Google.
Name | Type | Description |
---|---|---|
provider |
String
|
The provider name. |
authScheme |
String
|
The authentication scheme. |
profile |
Object
|
The profile. |
credentials |
Object
|
The credentials. |
[options] |
Object
|
The options. |
cb |
Function
|
The callback function. |
Name | Type | Description |
---|---|---|
err |
Error or String
|
The error object or string. |
user |
Object
|
The user object. |
[info] |
Object
|
The auth info object.
|
Link a third party account to a LoopBack user
Name | Type | Description |
---|---|---|
provider |
String
|
The provider name |
authScheme |
String
|
The authentication scheme |
profile |
Object
|
The profile |
credentials |
Object
|
The credentials |
[options] |
Object
|
The options |
cb |
Function
|
The callback function |
Name | Type | Description |
---|---|---|
err |
Error or String
|
The error object or string |
[credential] |
Object
|
The user credential object |
Link a third-party application credential with the LoopBack application.
Name | Type | Description |
---|---|---|
appId |
String
|
The LoopBack application iID. |
provider |
String
|
The third party provider name. |
authScheme |
String
|
The authentication scheme. |
credentials |
Object
|
Credentials for the given scheme. |
cb |
Function
|
The callback function. |
Name | Type | Description |
---|---|---|
err |
Error or String
|
The error object or string. |
user |
Object
|
The user object. |
[info] |
Object
|
The auth info object.
|
The passport configurator
Name | Type | Description |
---|---|---|
app |
Object
|
The LoopBack app instance |
Name | Type | Description |
---|---|---|
result |
PassportConfigurator
|
Setup the authentication request URLs.
Setup the authentication callback URLs.
Configure a Passport strategy provider.
Name | Type | Description |
---|---|---|
name |
String
|
The provider name |
General Options |
Object
|
Options for the auth provider. There are general options that apply to all providers, and provider-specific options, as described below. |
oAuth2 Options |
Object
|
Options for oAuth 2.0. |
Local Strategy Options |
Object
|
Options for local strategy. |
oAuth1 Options |
Object
|
Options for oAuth 1.0. |
OpenID Options |
Object
|
Options for OpenID. |
Name | Type | Description |
---|---|---|
link |
Boolean
|
Set to true if the provider is for third-party account linking. |
module |
Object
|
The passport strategy module from require. |
authScheme |
String
|
The authentication scheme, such as 'local', 'oAuth 2.0'. |
[session] |
Boolean
|
Set to true if session is required. Valid for any auth scheme. |
[authPath] |
String
|
Authentication route. |
Name | Type | Description |
---|---|---|
[clientID] |
String
|
oAuth 2.0 client ID. |
[clientSecret] |
String
|
oAuth 2.0 client secret. |
[callbackURL] |
String
|
oAuth 2.0 callback URL. |
[callbackPath] |
String
|
oAuth 2.0 callback route. |
[scope] |
String
|
oAuth 2.0 scopes. |
[successRedirect] |
String
|
The redirect route if login succeeds. For both oAuth 1 and 2. |
[failureRedirect] |
String
|
The redirect route if login fails. For both oAuth 1 and 2. |
Name | Type | Description |
---|---|---|
[usernameField] |
String
|
The field name for username on the form for local strategy. |
[passwordField] |
String
|
The field name for password on the form for local strategy. |
Name | Type | Description |
---|---|---|
[consumerKey] |
String
|
oAuth 1 consumer key. |
[consumerSecret] |
String
|
oAuth 1 consumer secret. |
[successRedirect] |
String
|
The redirect route if login succeeds. For both oAuth 1 and 2. |
[failureRedirect] |
String
|
The redirect route if login fails. For both oAuth 1 and 2. |
Name | Type | Description |
---|---|---|
[returnURL] |
String
|
OpenID return URL. |
[realm] |
String
|
OpenID realm. |
Initialize the passport configurator
Name | Type | Description |
---|---|---|
noSession |
Boolean
|
Set to true if no session is required |
Name | Type | Description |
---|---|---|
result |
Passport
|
Set up data models for user identity/credential and application credential
Name | Type | Description |
---|---|---|
options |
Object
|
Options for models |
Name | Type | Description |
---|---|---|
[userModel] |
Model
|
The user model class |
[userCredentialModel] |
Model
|
The user credential model class |
[userIdentityModel] |
Model
|
The user identity model class |