Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions pages/en/lb3/Configuring-providers.json.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ var passportConfigurator = new PassportConfigurator(app);
var config = {};
try {
config = require('../providers.json');
// If using custom passport module
config['custom-example'].verifyMethod = function(req, token, details, verified) {
verified(null, details);
}
} catch (err) {
console.trace(err);
process.exit(1); // fatal
Expand All @@ -48,6 +52,23 @@ Below is the providers.template.json file provided with [loopback-example-passp
"authPath": "/auth/local",
"successRedirect": "/auth/account"
},
"custom-example": {
"authScheme": "custom",
"provider": "custom-example",
"module": "loopback-passport-custom-strategy-example",
"authPath": "/auth/example",
"example": {
"id": "123",
"username": "example",
"email": "example@email.com",
"emailVerified": true
},
"authOptions": {
"successRedirect": "/auth/success",
"failureRedirect": "/auth/failure"
},
"passReqToVerify": true
},
"facebook-login": {
"provider": "facebook",
"module": "passport-facebook",
Expand Down Expand Up @@ -333,3 +354,36 @@ Used by Google and Facebook.
</tr>
</tbody>
</table>

### Custom

<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
<th>Example</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>authOptions</td>
<td>Object</td>
<td>Options passed to custom strategy authenticate method</td>
<td>
<p>"authOptions": {"successRedirect": "/auth/success", "failureRedirect": "/auth/failure"}</p>
</td>
</tr>
<tr>
<td>passReqToVerify</td>
<td>Boolean</td>
<td>Configures if the HTTP request object should be passed to verify method</td>
<td>
<p>true</p>
</td>
<td>false</td>
</tr>
</tbody>
</table>
2 changes: 1 addition & 1 deletion pages/en/lb3/Third-party-login-using-Passport.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The following table describes the properties of the UserIdentity model.
<tr>
<td>authScheme</td>
<td>String</td>
<td>auth scheme, such as oAuth, oAuth 2.0, OpenID, OpenID Connect</td>
<td>auth scheme, such as oAuth, oAuth 2.0, OpenID, OpenID Connect, Custom</td>
</tr>
<tr>
<td>externalId</td>
Expand Down