File tree Expand file tree Collapse file tree 3 files changed +62
-20
lines changed Expand file tree Collapse file tree 3 files changed +62
-20
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import AzureADProvider from "next-auth/providers/azure-ad"
21
21
import SpotifyProvider from "next-auth/providers/spotify"
22
22
import CognitoProvider from "next-auth/providers/cognito"
23
23
import SlackProvider from "next-auth/providers/slack"
24
+ import Okta from "next-auth/providers/okta"
24
25
25
26
// import { PrismaAdapter } from "@next-auth/prisma-adapter"
26
27
// import { PrismaClient } from "@prisma/client"
@@ -150,6 +151,11 @@ export default NextAuth({
150
151
clientSecret : process . env . COGNITO_SECRET ,
151
152
issuer : process . env . COGNITO_ISSUER ,
152
153
} ) ,
154
+ Okta ( {
155
+ clientId : process . env . OKTA_ID ,
156
+ clientSecret : process . env . OKTA_SECRET ,
157
+ issuer : process . env . OKTA_ISSUER ,
158
+ } ) ,
153
159
SlackProvider ( {
154
160
clientId : process . env . SLACK_ID ,
155
161
clientSecret : process . env . SLACK_SECRET ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { OAuthConfig , OAuthUserConfig } from "."
2
+
3
+ export interface OktaProfile {
4
+ iss : string
5
+ ver : string
6
+ sub : string
7
+ aud : string
8
+ iat : string
9
+ exp : string
10
+ jti : string
11
+ auth_time : string
12
+ amr : string
13
+ idp : string
14
+ nonce : string
15
+ name : string
16
+ nickname : string
17
+ preferred_username : string
18
+ given_name : string
19
+ middle_name : string
20
+ family_name : string
21
+ email : string
22
+ email_verified : string
23
+ profile : string
24
+ zoneinfo : string
25
+ locale : string
26
+ address : string
27
+ phone_number : string
28
+ picture : string
29
+ website : string
30
+ gender : string
31
+ birthdate : string
32
+ updated_at : string
33
+ at_hash : string
34
+ c_hash : string
35
+ }
36
+
37
+ export default function Okta < P extends Record < string , any > = OktaProfile > (
38
+ options : OAuthUserConfig < P >
39
+ ) : OAuthConfig < P > {
40
+ return {
41
+ id : "okta" ,
42
+ name : "Okta" ,
43
+ type : "oauth" ,
44
+ wellKnown : `${ options . issuer } /.well-known/openid-configuration` ,
45
+ authorization : { params : { scope : "openid email profile" } } ,
46
+ profile ( profile ) {
47
+ return {
48
+ id : profile . sub ,
49
+ name : profile . name ?? profile . preferred_username ,
50
+ email : profile . email ,
51
+ image : profile . picture ,
52
+ }
53
+ } ,
54
+ options,
55
+ }
56
+ }
You can’t perform that action at this time.
0 commit comments