Integrate with Node-RED
Support level: Community
What is Node-RED?
Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.
It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.
Preparation
The following placeholders are used in this guide:
authentik.companyis the FQDN of authentik.nodered.companyis the FQDN of Node-RED.
This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application.
This integration requires modifying the Node-RED settings.js file and installing the passport-openidconnect package.
authentik configuration
In authentik versions earlier than 2026.5, all Redirect URIs are automatically treated as Authorization type. If you are using one of these older authentik versions, add only the Authorization URL to your Redirect URIs and do not configure a Post Logout URI.
To support the integration of Node-RED with authentik, you need to create an application/provider pair in authentik.
Create an application and provider
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Applications > Applications and click New Application to create an application and provider pair. (Alternatively you can first create a provider separately, then create the application and connect it with the provider.)
- Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. Take note of the Slug value because it is required later.
- Choose a Provider type: select OAuth2/OpenID Connect as the provider type.
- Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
- Note the Client ID and Client Secret values because they will be required later.
- Add a Redirect URI of type
StrictAuthorizationashttps://nodered.company/auth/strategy/callback. - Select any available signing key.
- Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's Application Dashboard page.
- Click Submit to save the new application and provider.
Node-RED configuration
Install the Passport strategy
Use npm to install passport-openidconnect in the Node-RED user directory. In the official Node-RED Docker container, this directory is /data; for a standard installation, it is usually ~/.node-red.
npm install passport-openidconnect
Configure editor authentication
Edit the Node-RED settings.js file to use the external authentication source through passport-openidconnect. Group-based permissions are not implemented in this example, so every user who successfully authenticates receives full editor permissions.
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 from authentik>",
clientSecret: "<Client Secret from authentik>",
callbackURL: "https://nodered.company/auth/strategy/callback",
scope: ["email", "profile", "openid"],
proxy: true,
},
},
users: function(user) {
return Promise.resolve({ username: user, permissions: "*" });
},
},
Restart Node-RED after saving settings.js.
Configuration verification
To confirm that authentik is properly configured with Node-RED, open Node-RED and sign in with authentik. You should be redirected to authentik and returned to the Node-RED editor after authentication.