Node-RED
Sign in to the Node-RED editor with Pocket ID.
Create the client in Pocket ID
Section titled “Create the client in Pocket ID”- In Pocket ID, open Administration → OIDC Clients and click Add OIDC Client.
- Enter a name such as
Node-REDand add the callback URLhttps://nodered.example.com/auth/strategy/callback. - 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.
- On the client’s Access tab, select the groups that may sign in under Allowed User Groups, or choose All Users.
Configure Node-RED
Section titled “Configure Node-RED”-
Make sure the following Passport strategy package is installed:
Terminal window npm install passport-openidconnect -
Replace the
adminAuthsection insettings.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: "*" });}}, -
Restart the container after editing
settings.js.