Skip to content

Commit 219831d

Browse files
authored
Fix description for Twitch auth (#201)
1 parent c16f2b2 commit 219831d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,35 @@ declare module 'fastify' {
259259
}
260260
```
261261

262+
## Provider Quirks
263+
264+
The following providers require additional work to be set up correctly.
265+
266+
### Twitch
267+
268+
Twitch requires that the request for a token in the oauth2 flow contains the `client_id` and `client_secret` properties in `tokenRequestParams`:
269+
270+
```js
271+
fastify.register(oauthPlugin, {
272+
name: 'twitchOauth2',
273+
credentials: {
274+
client: {
275+
id: '<CLIENT_ID>',
276+
secret: '<CLIENT_SECRET>'
277+
},
278+
auth: oauthPlugin.TWITCH_CONFIGURATION
279+
},
280+
tokenRequestParams: {
281+
client_id: '<CLIENT_ID>',
282+
client_secret: '<CLIENT_SECRET>',
283+
},
284+
// register a fastify url to start the redirect flow
285+
startRedirectPath: '/login/twitch',
286+
// twitch redirect here after the user login
287+
callbackUri: 'http://localhost:3000/login/twitch/callback'
288+
})
289+
```
290+
262291
## License
263292

264293
Licensed under [MIT](./LICENSE).

0 commit comments

Comments
 (0)