File tree 4 files changed +91
-1
lines changed
docs/versioned_docs/version-v3/providers
packages/next-auth/src/providers
4 files changed +91
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import TwitterProvider, {
8
8
} from "next-auth/providers/twitter"
9
9
import CredentialsProvider from "next-auth/providers/credentials"
10
10
import IDS4Provider from "next-auth/providers/identity-server4"
11
+ import DuendeIDS6Provider from "next-auth/providers/duende-identity-server6"
11
12
import Twitch from "next-auth/providers/twitch"
12
13
import GoogleProvider from "next-auth/providers/google"
13
14
import FacebookProvider from "next-auth/providers/facebook"
@@ -150,6 +151,11 @@ export const authOptions: NextAuthOptions = {
150
151
clientSecret : process . env . IDS4_SECRET ,
151
152
issuer : process . env . IDS4_ISSUER ,
152
153
} ) ,
154
+ DuendeIDS6Provider ( {
155
+ clientId : "interactive.confidential" ,
156
+ clientSecret : "secret" ,
157
+ issuer : "https://demo.duendesoftware.com" ,
158
+ } ) ,
153
159
DiscordProvider ( {
154
160
clientId : process . env . DISCORD_ID ,
155
161
clientSecret : process . env . DISCORD_SECRET ,
Original file line number Diff line number Diff line change
1
+ ---
2
+ id : duende-identityserver6
3
+ title : DuendeIdentityServer6
4
+ ---
5
+
6
+ ## Documentation
7
+
8
+ https://docs.duendesoftware.com/identityserver/v6
9
+
10
+ ## Options
11
+
12
+ The ** DuendeIdentityServer6 Provider** comes with a set of default options:
13
+
14
+ - [ DuendeIdentityServer6 Provider options] ( https://github.com/nextauthjs/next-auth/tree/main/packages/next-auth/src/providers/duende-identity-server6.ts )
15
+
16
+ You can override any of the options to suit your own use case.
17
+
18
+ ## Example
19
+
20
+ ``` js
21
+ import DuendeIDS6Provider from " next-auth/providers/duende-identity-server6"
22
+
23
+ ...
24
+ providers: [
25
+ DuendeIDS6Provider ({
26
+ clientId: process .env .DUENDE_IDS6_ID ,
27
+ clientSecret: process .env .DUENDE_IDS6_SECRET ,
28
+ issuer: process .env .DUENDE_IDS6_ISSUER ,
29
+ })
30
+ ]
31
+ ...
32
+ ```
33
+
34
+ ## Demo IdentityServer
35
+
36
+ The configuration below is for the demo server at https://demo.duendesoftware.com/
37
+
38
+ If you want to try it out, you can copy and paste the configuration below.
39
+
40
+ You can sign in to the demo service with either <b >bob/bob</b > or <b >alice/alice</b >.
41
+
42
+ ``` js
43
+ import DuendeIDS6Provider from " next-auth/providers/duende-identity-server6"
44
+ ...
45
+ providers: [
46
+ DuendeIDS6Provider ({
47
+ clientId: " interactive.confidential" ,
48
+ clientSecret: " secret" ,
49
+ issuer: " https://demo.duendesoftware.com" ,
50
+ })
51
+ ]
52
+ ...
53
+ ```
Original file line number Diff line number Diff line change @@ -54,6 +54,6 @@ providers: [
54
54
clientSecret: " secret" ,
55
55
protection: " pkce"
56
56
})
57
- }
57
+ ]
58
58
...
59
59
```
Original file line number Diff line number Diff line change
1
+ import type { OAuthConfig , OAuthUserConfig } from "./oauth"
2
+
3
+ export interface DuendeISUser extends Record < string , any > {
4
+ email : string
5
+ id : string
6
+ name : string
7
+ verified : boolean
8
+ }
9
+
10
+ export default function DuendeIdentityServer6 < P extends DuendeISUser > (
11
+ options : OAuthUserConfig < P >
12
+ ) : OAuthConfig < P > {
13
+ return {
14
+ id : "duende-identityserver6" ,
15
+ name : "DuendeIdentityServer6" ,
16
+ type : "oauth" ,
17
+ wellKnown : `${ options . issuer } /.well-known/openid-configuration` ,
18
+ authorization : { params : { scope : "openid profile email" } } ,
19
+ checks : [ "pkce" , "state" ] ,
20
+ idToken : true ,
21
+ profile ( profile ) {
22
+ return {
23
+ id : profile . sub ,
24
+ name : profile . name ,
25
+ email : profile . email ,
26
+ image : null ,
27
+ }
28
+ } ,
29
+ options,
30
+ }
31
+ }
You can’t perform that action at this time.
1 commit comments
vercel[bot] commentedon Jul 7, 2022
Successfully deployed to the following URLs:
next-auth – ./
next-auth-git-main-nextauthjs.vercel.app
next-auth.js.org
next-auth-nextauthjs.vercel.app
www.next-auth.js.org
next-auth-phi-two.vercel.app