mirror of
https://github.com/pocket-id/website.git
synced 2026-02-16 14:27:17 -08:00
1.7 KiB
1.7 KiB
title, description
| title | description |
|---|---|
| Node-RED | Set up Node-RED with Pocket ID authentication |
Pocket ID Setup
- In Pocket-ID create a new OIDC Client, name it i.e.
node-red. - Set a logo for this OIDC Client if you would like too.
- Set the callback URL to:
https://nodered.yoururl.com/auth/strategy/callback, or leave blank to autofill on first login. - Copy the
Client ID, andClient Secretfor use in the next steps.
Node-RED Setup
Make sure the following "Passport strategy" package is installed:
npm install passport-openidconnect
Replace the adminAuth section in settings.js (adjust to your specific requirements):
adminAuth: {
type: 'strategy',
strategy: {
name: 'openidconnect',
label: 'Sign in with Pocked-ID',
icon: 'fa-openid',
strategy: require('passport-openidconnect').Strategy,
options: {
issuer: 'https://pocketid.yoururl.com',
authorizationURL: 'https://pocketid.yoururl.com/authorize',
tokenURL: 'https://pocketid.yoururl.com/api/oidc/token',
userInfoURL: 'https://pocketid.yoururl.com/api/oidc/userinfo',
clientID: 'yourclientid',
clientSecret: 'yourclientsecret',
callbackURL: 'https://node-red.yoururl.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 the settings.js file.