Compare commits

...

3 Commits

Author SHA1 Message Date
Tana M Berry
5e80241203 rebased, tweaked to bump build 2025-07-21 13:06:44 -05:00
Germán Martín
a82c5e2754 Fix format
Signed-off-by: Germán Martín <github@gmartin.net>
2025-07-21 12:58:01 -05:00
Germán Martín
1670817899 Update Node-RED configuration
After playing around it for a couple days I found that Node-red uses 4 parameters in verify function. This configuration is working for me.

https://discourse.nodered.org/t/setting-up-oidc-with-authentik-gives-syntaxerror-unexpected-token-not-valid-json/97981

Signed-off-by: Germán Martín <github@gmartin.net>
2025-07-21 12:58:01 -05:00

View File

@@ -13,7 +13,7 @@ support_level: community
> -- https://nodered.org/
:::caution
This requires modification of the Node-RED settings.js and installing additional Passport-js packages, see [Securing Node-RED](https://nodered.org/docs/user-guide/runtime/securing-node-red#oauthopenid-based-authentication) documentation for further details.
This requires modification of the Node-RED `settings.js` file and installing additional Passport-js packages; see [Securing Node-RED](https://nodered.org/docs/user-guide/runtime/securing-node-red#oauthopenid-based-authentication) documentation for further details.
:::
## Preparation
@@ -66,29 +66,29 @@ Edit the node-red settings.js file `/data/settings.js` to use the external authe
```js
adminAuth: {
type:"strategy",
strategy: {
name: "openidconnect",
label: 'Sign in with authentik',
icon:"fa-cloud",
strategy: require("passport-openidconnect").Strategy,
options: {
issuer: 'https://authentik.company/application/o/<application_slug>/',
authorizationURL: 'https://authentik.company/application/o/authorize/',
tokenURL: 'https://authentik.company/application/o/token/',
userInfoURL: 'https://authentik.company/application/o/userinfo/',
clientID: '<Client ID (Key): Step 2>',
clientSecret: '<Client Secret: Step 2>',
callbackURL: 'https://nodered.company/auth/strategy/callback/',
scope: ['email', 'profile', 'openid'],
proxy: true,
verify: function(issuer, profile, done) {
done(null, profile)
type:"strategy",
strategy: {
name: "openidconnect",
label: 'Sign in with authentik',
icon:"fa-cloud",
strategy: require("passport-openidconnect").Strategy,
options: {
issuer: 'https://authentik.company/application/o/<application_slug>/',
authorizationURL: 'https://authentik.company/application/o/authorize/',
tokenURL: 'https://authentik.company/application/o/token/',
userInfoURL: 'https://authentik.company/application/o/userinfo/',
clientID: '<Client ID (Key): Step 2>',
clientSecret: '<Client Secret: Step 2>',
callbackURL: 'https://nodered.company/auth/strategy/callback/',
scope: ['email', 'profile', 'openid'],
proxy: true,
verify: function(context, issuer, profile, done) {
return done(null, profile);
},
}
},
users: function(user) {
return Promise.resolve({ username: user, permissions: "*" });
}
}
},
users: function(user) {
return Promise.resolve({ username: user, permissions: "*" });
}
},
```