Implement OpenID Connect Authentication Strategy (works with Keycloak, Authentik etc.)

This commit is contained in:
Amruth Pillai
2025-01-13 15:56:29 +01:00
parent 0f8f2fe560
commit eb7813ac6f
20 changed files with 320 additions and 18 deletions

96
pnpm-lock.yaml generated
View File

@ -162,8 +162,8 @@ importers:
specifier: ^0.5.15
version: 0.5.15
'@tanstack/react-query':
specifier: ^5.64.0
version: 5.64.0(react@18.3.1)
specifier: ^5.64.1
version: 5.64.1(react@18.3.1)
'@tiptap/extension-highlight':
specifier: ^2.11.2
version: 2.11.2(@tiptap/core@2.11.2(@tiptap/pm@2.11.2))
@ -221,6 +221,9 @@ importers:
deepmerge:
specifier: ^4.3.1
version: 4.3.1
express-session:
specifier: ^1.18.1
version: 1.18.1
file-saver:
specifier: ^2.0.5
version: 2.0.5
@ -290,6 +293,9 @@ importers:
passport-local:
specifier: ^1.0.0
version: 1.0.0
passport-openidconnect:
specifier: ^0.1.2
version: 0.1.2
pdf-lib:
specifier: ^1.17.1
version: 1.17.1
@ -474,6 +480,9 @@ importers:
'@types/express':
specifier: ^4.17.21
version: 4.17.21
'@types/express-session':
specifier: ^1.18.1
version: 1.18.1
'@types/file-saver':
specifier: ^2.0.7
version: 2.0.7
@ -513,6 +522,9 @@ importers:
'@types/passport-local':
specifier: ^1.0.38
version: 1.0.38
'@types/passport-openidconnect':
specifier: ^0.1.3
version: 0.1.3
'@types/prismjs':
specifier: ^1.26.5
version: 1.26.5
@ -3978,11 +3990,11 @@ packages:
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
'@tanstack/query-core@5.64.0':
resolution: {integrity: sha512-/MPJt/AaaMzdWJZTafgMyYhEX/lGjQrNz8+NDQSk8fNoU5PHqh05FhQaBrEQafW2PeBHsRbefEf//qKMiSAbQQ==}
'@tanstack/query-core@5.64.1':
resolution: {integrity: sha512-978Wx4Wl4UJZbmvU/rkaM9cQtXXrbhK0lsz/UZhYIbyKYA8E4LdomTwyh2GHZ4oU0BKKoDH4YlKk2VscCUgNmg==}
'@tanstack/react-query@5.64.0':
resolution: {integrity: sha512-tBMzlROROUcTDMpDt1NC3n9ndKnJHPB3RCpa6Bf9f31TFvqhLz879x8jldtKU+6IwMSw1Pn4K1AKA+2SYyA6TA==}
'@tanstack/react-query@5.64.1':
resolution: {integrity: sha512-vW5ggHpIO2Yjj44b4sB+Fd3cdnlMJppXRBJkEHvld6FXh3j5dwWJoQo7mGtKI2RbSFyiyu/PhGAy0+Vv5ev9Eg==}
peerDependencies:
react: ^18 || ^19
@ -4261,6 +4273,9 @@ packages:
'@types/express-serve-static-core@4.17.43':
resolution: {integrity: sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==}
'@types/express-session@1.18.1':
resolution: {integrity: sha512-S6TkD/lljxDlQ2u/4A70luD8/ZxZcrU5pQwI1rVXCiaVIywoFgbA+PIUNDjPhQpPdK0dGleLtYc/y7XWBfclBg==}
'@types/express@4.17.21':
resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==}
@ -4402,6 +4417,9 @@ packages:
'@types/passport-oauth2@1.4.15':
resolution: {integrity: sha512-9cUTP/HStNSZmhxXGuRrBJfEWzIEJRub2eyJu3CvkA+8HAMc9W3aKdFhVq+Qz1hi42qn+GvSAnz3zwacDSYWpw==}
'@types/passport-openidconnect@0.1.3':
resolution: {integrity: sha512-k1Ni7bG/9OZNo2Qpjg2W6GajL+pww6ZPaNWMXfpteCX4dXf4QgaZLt2hjR5IiPrqwBT9+W8KjCTJ/uhGIoBx/g==}
'@types/passport-strategy@0.2.38':
resolution: {integrity: sha512-GC6eMqqojOooq993Tmnmp7AUTbbQSgilyvpCYQjT+H6JfG/g6RGc7nXEniZlp0zyKJ0WUdOiZWLBZft9Yug1uA==}
@ -5600,6 +5618,9 @@ packages:
cookie-signature@1.0.6:
resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==}
cookie-signature@1.0.7:
resolution: {integrity: sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==}
cookie@0.6.0:
resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==}
engines: {node: '>= 0.6'}
@ -6501,6 +6522,10 @@ packages:
resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
express-session@1.18.1:
resolution: {integrity: sha512-a5mtTqEaZvBCL9A9aqkrtfz+3SMDhOVUnjafjo+s7A9Txkq+SVX2DLvSp1Zrv4uCXa3lMSK3viWnh9Gg07PBUA==}
engines: {node: '>= 0.8.0'}
express@4.19.2:
resolution: {integrity: sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==}
engines: {node: '>= 0.10.0'}
@ -8897,6 +8922,10 @@ packages:
resolution: {integrity: sha512-cjsQbOrXIDE4P8nNb3FQRCCmJJ/utnFKEz2NX209f7KOHPoX18gF7gBzBbLLsj2/je4KrgiwLLGjf0lm9rtTBA==}
engines: {node: '>= 0.4.0'}
passport-openidconnect@0.1.2:
resolution: {integrity: sha512-JX3rTyW+KFZ/E9OF/IpXJPbyLO9vGzcmXB5FgSP2jfL3LGKJPdV7zUE8rWeKeeI/iueQggOeFa3onrCmhxXZTg==}
engines: {node: '>= 0.6.0'}
passport-strategy@1.0.0:
resolution: {integrity: sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==}
engines: {node: '>= 0.4.0'}
@ -9614,6 +9643,10 @@ packages:
ramda@0.27.2:
resolution: {integrity: sha512-SbiLPU40JuJniHexQSAgad32hfwd+DRUdwF2PlVuI5RZD0/vahUco7R8vD86J/tcEKKF9vZrUVwgtmGCqlCKyA==}
random-bytes@1.0.0:
resolution: {integrity: sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==}
engines: {node: '>= 0.8'}
randombytes@2.1.0:
resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==}
@ -10891,6 +10924,10 @@ packages:
engines: {node: '>=0.8.0'}
hasBin: true
uid-safe@2.1.5:
resolution: {integrity: sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==}
engines: {node: '>= 0.8'}
uid2@0.0.4:
resolution: {integrity: sha512-IevTus0SbGwQzYh3+fRsAMTVVPOoIVufzacXcHPmdlle1jUpq7BRL+mw3dgeLanvGZdwwbWhRV6XrcFNdBmjWA==}
@ -12739,7 +12776,7 @@ snapshots:
'@eslint/eslintrc@2.1.4':
dependencies:
ajv: 6.12.6
debug: 4.3.6
debug: 4.4.0
espree: 9.6.1
globals: 13.24.0
ignore: 5.3.1
@ -12808,7 +12845,7 @@ snapshots:
'@humanwhocodes/config-array@0.11.14':
dependencies:
'@humanwhocodes/object-schema': 2.0.3
debug: 4.3.6
debug: 4.4.0
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
@ -15661,11 +15698,11 @@ snapshots:
- supports-color
- typescript
'@tanstack/query-core@5.64.0': {}
'@tanstack/query-core@5.64.1': {}
'@tanstack/react-query@5.64.0(react@18.3.1)':
'@tanstack/react-query@5.64.1(react@18.3.1)':
dependencies:
'@tanstack/query-core': 5.64.0
'@tanstack/query-core': 5.64.1
react: 18.3.1
'@testing-library/dom@10.1.0':
@ -15984,6 +16021,10 @@ snapshots:
'@types/range-parser': 1.2.7
'@types/send': 0.17.4
'@types/express-session@1.18.1':
dependencies:
'@types/express': 4.17.21
'@types/express@4.17.21':
dependencies:
'@types/body-parser': 1.19.5
@ -16164,6 +16205,13 @@ snapshots:
'@types/oauth': 0.9.4
'@types/passport': 1.0.17
'@types/passport-openidconnect@0.1.3':
dependencies:
'@types/express': 4.17.21
'@types/oauth': 0.9.4
'@types/passport': 1.0.17
'@types/passport-strategy': 0.2.38
'@types/passport-strategy@0.2.38':
dependencies:
'@types/express': 4.17.21
@ -17621,6 +17669,8 @@ snapshots:
cookie-signature@1.0.6: {}
cookie-signature@1.0.7: {}
cookie@0.6.0: {}
cookie@0.7.1: {}
@ -18737,6 +18787,19 @@ snapshots:
jest-message-util: 29.7.0
jest-util: 29.7.0
express-session@1.18.1:
dependencies:
cookie: 0.7.2
cookie-signature: 1.0.7
debug: 2.6.9
depd: 2.0.0
on-headers: 1.0.2
parseurl: 1.3.3
safe-buffer: 5.2.1
uid-safe: 2.1.5
transitivePeerDependencies:
- supports-color
express@4.19.2:
dependencies:
accepts: 1.3.8
@ -21918,6 +21981,11 @@ snapshots:
uid2: 0.0.4
utils-merge: 1.0.1
passport-openidconnect@0.1.2:
dependencies:
oauth: 0.10.0
passport-strategy: 1.0.0
passport-strategy@1.0.0: {}
passport@0.7.0:
@ -22646,6 +22714,8 @@ snapshots:
ramda@0.27.2: {}
random-bytes@1.0.0: {}
randombytes@2.1.0:
dependencies:
safe-buffer: 5.2.1
@ -24117,6 +24187,10 @@ snapshots:
uglify-js@3.17.4:
optional: true
uid-safe@2.1.5:
dependencies:
random-bytes: 1.0.0
uid2@0.0.4: {}
uid@2.0.2: