Skip to content

Commit

Permalink
Documented sending dynamic params to Strategy via authenticate()
Browse files Browse the repository at this point in the history
  • Loading branch information
prust committed Jan 19, 2023
1 parent 694adf3 commit daa70a5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,16 @@ Creates a new Strategy

---

The strategy automatically generates `state` and `nonce` parameters when required. To provide one for a flow where it is optional (for example the `nonce` for the Authorization Code Flow), it can be passed in the optional `options` argument to `passport.authenticate()`:

```js
app.post('/auth/openid', function(req, res, next) {
passport.authenticate('oidc', { nonce: crypto.randomBytes(16).toString('base64url') })(req, res, next);
});
```

---

## generators

<!-- TOC generators START -->
Expand Down

0 comments on commit daa70a5

Please sign in to comment.