Skip to content
v2.18.0GitHub

Node-RED

Sign in to the Node-RED editor with Pocket ID.

  1. In Pocket ID, open Administration → OIDC Clients and click Add OIDC Client.
  2. Enter a name such as Node-RED and add the callback URL https://nodered.example.com/auth/strategy/callback.
  3. Click Create and copy the Client ID and the Client secret. Under Show more details, also copy the Authorization URL, the Token URL and the Userinfo URL. The client secret is only shown once.
  4. On the client’s Access tab, select the groups that may sign in under Allowed User Groups, or choose All Users.
  1. Make sure the following Passport strategy package is installed:

    Terminal window
    npm install passport-openidconnect
  2. Replace the adminAuth section in settings.js (adjust it to your requirements):

    adminAuth: {
    type: 'strategy',
    strategy: {
    name: 'openidconnect',
    label: 'Sign in with Pocket ID',
    icon: 'fa-openid',
    strategy: require('passport-openidconnect').Strategy,
    options: {
    issuer: 'https://id.example.com',
    authorizationURL: 'https://id.example.com/authorize',
    tokenURL: 'https://id.example.com/api/oidc/token',
    userInfoURL: 'https://id.example.com/api/oidc/userinfo',
    clientID: '<client-id>',
    clientSecret: '<client-secret>',
    callbackURL: 'https://nodered.example.com/auth/strategy/callback',
    scope: ['openid', 'email', 'profile', 'groups'],
    proxy: true,
    verify: function(issuer, profile, done) {
    done(null, profile)
    }
    }
    },
    users: function(user) {
    return Promise.resolve({ username: user, permissions: "*" });
    }
    },
  3. Restart the container after editing settings.js.