File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ export default function WorkOS ( options ) {
2
+ return {
3
+ id : 'workos' ,
4
+ name : 'WorkOS' ,
5
+ type : 'oauth' ,
6
+ version : '2.0' ,
7
+ scope : '' ,
8
+ params : {
9
+ grant_type : 'authorization_code' ,
10
+ client_id : options . clientId ,
11
+ client_secret : options . clientSecret
12
+ } ,
13
+ accessTokenUrl : 'https://api.workos.com/sso/token/' ,
14
+ authorizationUrl : `https://api.workos.com/sso/authorize/?response_type=code&domain=${ options . domain } ` ,
15
+ profileUrl : 'https://api.workos.com/sso/profile/' ,
16
+ profile : ( profile ) => {
17
+ return {
18
+ ...profile ,
19
+ name : `${ profile . first_name } ${ profile . last_name } `
20
+ }
21
+ } ,
22
+ ...options
23
+ }
24
+ }
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ export type OAuthProviderType =
94
94
| "Twitter"
95
95
| "VK"
96
96
| "WordPress"
97
+ | "WorkOS"
97
98
| "Yandex"
98
99
| "Zoho"
99
100
Original file line number Diff line number Diff line change
1
+ ---
2
+ id : workos
3
+ title : WorkOS
4
+ ---
5
+
6
+ ## Documentation
7
+
8
+ https://workos.com/docs/sso/guide
9
+
10
+ ## Options
11
+
12
+ The ** WorkOS Provider** comes with a set of default options:
13
+
14
+ - [ WorkOS Provider options] ( https://github.com/nextauthjs/next-auth/blob/main/src/providers/workos.js )
15
+
16
+ You can override any of the options to suit your own use case.
17
+
18
+ ## Example
19
+
20
+ ``` js
21
+ import Providers from ` next-auth/providers`
22
+ ...
23
+ providers: [
24
+ Providers .WorkOS ({
25
+ clientId: process .env .WORKOS_ID ,
26
+ clientSecret: process .env .WORKOS_SECRET ,
27
+ domain: process .env .WORKOS_DOMAIN
28
+ }),
29
+ ],
30
+ ...
31
+ ```
You can’t perform that action at this time.
0 commit comments