{"_id":"@cappern/node-red-dashboard-2-oauth2-auth","_rev":"3-164bd109bce0863faa9b95618193fc19","name":"@cappern/node-red-dashboard-2-oauth2-auth","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.2":{"name":"@cappern/node-red-dashboard-2-oauth2-auth","version":"0.1.2","keywords":["node-red","node-red-plugin","dashboard","oauth2","auth","oauth2-proxy","oidc"],"author":{"name":"cappern"},"license":"AGPL-3.0-or-later","_id":"@cappern/node-red-dashboard-2-oauth2-auth@0.1.2","maintainers":[{"name":"cappern","email":"christoffer@cappelen.org"}],"homepage":"https://github.com/cappern/node-red-dashboard-2-oauth2-auth#readme","bugs":{"url":"https://github.com/cappern/node-red-dashboard-2-oauth2-auth/issues"},"dist":{"shasum":"5296dbf9970ffb696dd02395f57369527fdb1ff5","tarball":"https://registry.npmjs.org/@cappern/node-red-dashboard-2-oauth2-auth/-/node-red-dashboard-2-oauth2-auth-0.1.2.tgz","fileCount":4,"integrity":"sha512-WdmzLAybhWh4v3ySx318i3VhN9UReUh6ahZ6GOP6VMJPcgnqXZGTiw3S0JrScm1PMetcmxv/bxg9S7wa6gB3HQ==","signatures":[{"sig":"MEYCIQC8c1cyV8YU0ul6KB1OJhwLWdwBcZQ3D7NRV8ShoxcWhQIhAJytsR7R80JEPzQJU/05k6tupiFXNZzod+O5Uebzc/nQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7426},"main":"index.js","gitHead":"cb817081c9db3a1e0f4ab4f904de7dc7c2a24455","_npmUser":{"name":"cappern","email":"christoffer@cappelen.org"},"node-red":{"plugins":{"node-red-dashboard-oauth2-proxy-auth":"index.js"}},"repository":{"url":"git+https://github.com/cappern/node-red-dashboard-2-oauth2-auth.git","type":"git"},"_npmVersion":"10.9.3","description":"OAuth2-Proxy based authentication plugin for node-red-dashboard-2","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/node-red-dashboard-2-oauth2-auth_0.1.2_1756408053449_0.410945374350167","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@cappern/node-red-dashboard-2-oauth2-auth","version":"0.1.3","keywords":["node-red","node-red-plugin","dashboard","oauth2","auth","oauth2-proxy","oidc"],"author":{"name":"cappern"},"license":"AGPL-3.0-or-later","_id":"@cappern/node-red-dashboard-2-oauth2-auth@0.1.3","maintainers":[{"name":"cappern","email":"christoffer@cappelen.org"}],"homepage":"https://github.com/cappern/node-red-dashboard-2-oauth2-auth#readme","bugs":{"url":"https://github.com/cappern/node-red-dashboard-2-oauth2-auth/issues"},"dist":{"shasum":"aa1a85fc7bfae270fedade725674003ca5d945ff","tarball":"https://registry.npmjs.org/@cappern/node-red-dashboard-2-oauth2-auth/-/node-red-dashboard-2-oauth2-auth-0.1.3.tgz","fileCount":4,"integrity":"sha512-zXS5DCHP2KVuoFBebYRPzofDjkaa3XaVhM6Yahrqno2QFwPjQxKCtZB63sb3D1qpnhsuDgHKxMo2TvSN29Ivog==","signatures":[{"sig":"MEQCIA8T5wFPwd1Uqmqvu9dxJTTdnfMCNIJbrKWVsOuhD6MKAiA+daaYqpFi6YVt62dr4e5OHeXtgNxXZMsVU3tibdgFpw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7422},"main":"index.js","gitHead":"60427f0363bc4fe7f54f0e4de59ff4074e0c05ab","_npmUser":{"name":"cappern","email":"christoffer@cappelen.org"},"node-red":{"plugins":{"node-red-dashboard-2-oauth2-auth":"index.js"}},"repository":{"url":"git+https://github.com/cappern/node-red-dashboard-2-oauth2-auth.git","type":"git"},"_npmVersion":"10.9.3","description":"OAuth2-Proxy based authentication plugin for node-red-dashboard-2","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/node-red-dashboard-2-oauth2-auth_0.1.3_1756408609263_0.3241304609542335","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@cappern/node-red-dashboard-2-oauth2-auth","version":"0.1.4","description":"OAuth2-Proxy based authentication plugin for node-red-dashboard-2","main":"index.js","keywords":["node-red","node-red-plugin","dashboard","oauth2","auth","oauth2-proxy","oidc"],"author":{"name":"cappern"},"license":"AGPL-3.0-or-later","repository":{"type":"git","url":"git+https://github.com/cappern/node-red-dashboard-2-oauth2-auth.git"},"bugs":{"url":"https://github.com/cappern/node-red-dashboard-2-oauth2-auth/issues"},"homepage":"https://github.com/cappern/node-red-dashboard-2-oauth2-auth#readme","node-red":{"plugins":{"node-red-dashboard-2-oauth2-auth":"index.js"}},"_id":"@cappern/node-red-dashboard-2-oauth2-auth@0.1.4","gitHead":"6520b16fe59442d0abd24088284325f4559950f9","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-jWLpgIYAY9+3JopwXQePh0qDBZapGUG1R4JlhqJT+5ZBqQlfx3zqs1KE2scqjTKD3d1IJmzYUZlyruZOfA1NUw==","shasum":"47f99291bfab070f57e2557652914b6eb39f9d62","tarball":"https://registry.npmjs.org/@cappern/node-red-dashboard-2-oauth2-auth/-/node-red-dashboard-2-oauth2-auth-0.1.4.tgz","fileCount":4,"unpackedSize":9488,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIB6SepqOjgSJi3vTaE4hbc17LnQbQcvXkeHa842dY8EHAiEAkiN/xitnueeuSyoDcKeYiKVK3uI6Le1YicqAhtD/DiY="}]},"_npmUser":{"name":"cappern","email":"christoffer@cappelen.org"},"directories":{},"maintainers":[{"name":"cappern","email":"christoffer@cappelen.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/node-red-dashboard-2-oauth2-auth_0.1.4_1756417023886_0.16687430029896833"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-28T19:07:33.362Z","modified":"2025-08-28T21:37:04.262Z","0.1.2":"2025-08-28T19:07:33.698Z","0.1.3":"2025-08-28T19:16:49.428Z","0.1.4":"2025-08-28T21:37:04.078Z"},"bugs":{"url":"https://github.com/cappern/node-red-dashboard-2-oauth2-auth/issues"},"author":{"name":"cappern"},"license":"AGPL-3.0-or-later","homepage":"https://github.com/cappern/node-red-dashboard-2-oauth2-auth#readme","keywords":["node-red","node-red-plugin","dashboard","oauth2","auth","oauth2-proxy","oidc"],"repository":{"type":"git","url":"git+https://github.com/cappern/node-red-dashboard-2-oauth2-auth.git"},"description":"OAuth2-Proxy based authentication plugin for node-red-dashboard-2","maintainers":[{"name":"cappern","email":"christoffer@cappelen.org"}],"readme":"# @cappern/node-red-dashboard-2-oauth2-auth\r\n\r\n[![Node-RED](https://img.shields.io/badge/Node--RED-Dashboard%202-blue)](https://nodered.org)\r\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL--3.0--or--later-blue.svg)](./LICENSE)\r\n\r\nA [Node-RED Dashboard 2](https://github.com/flowfuse/node-red-dashboard) plugin that integrates with [oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy/).  \r\nIt extracts user information from the HTTP headers added by oauth2-proxy and makes them available inside Dashboard flows via `msg._client.user`.\r\n\r\n---\r\n\r\n## 🚀 Features\r\n\r\n- Automatically attaches user info to `msg._client.user`\r\n- Supports common oauth2-proxy headers:\r\n  - `x-auth-request-user`, `x-forwarded-user`\r\n  - `x-auth-request-email`, `x-forwarded-email`\r\n  - `x-auth-request-preferred-username`\r\n- Adds `socketId` and `socketIp` to help trace individual client sessions\r\n- Prevents unauthenticated users from interacting with flows (configurable in hook `onIsValidConnection`)\r\n\r\n---\r\n\r\n## 📦 Installation\r\n\r\nFrom your Node-RED user directory (e.g. `~/.node-red` or `/data` inside Docker):\r\n\r\n```bash\r\nnpm install @cappern/node-red-dashboard-2-oauth2-auth\r\n```\r\n\r\nRestart Node-RED after installation.\r\n\r\n---\r\n\r\n## 🔧 Usage\r\n\r\n1. Run Node-RED Dashboard 2 behind [oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy/)  \r\n   (for example with Traefik, Nginx, or another reverse proxy).\r\n2. Ensure oauth2-proxy is configured to forward user headers (e.g. `--set-xauthrequest`).\r\n3. Open **Dashboard → Sidebar → Client Data**.  \r\n   You should see **OAuth2 Proxy** listed as a client data provider.\r\n4. In your flows, you can now access user info:\r\n\r\n```json\r\n{\r\n  \"_client\": {\r\n    \"user\": {\r\n      \"userId\": \"jdoe\",\r\n      \"email\": \"jdoe@example.com\",\r\n      \"username\": \"jdoe\"\r\n    },\r\n    \"socketId\": \"s0meid\",\r\n    \"socketIp\": \"192.168.1.100\"\r\n  }\r\n}\r\n```\r\n\r\n---\r\n\r\n## 📜 License\r\n\r\nThis project is licensed under the [AGPL-3.0-or-later](./LICENSE).\r\n\r\n---\r\n\r\n## 🤝 Contributing\r\n\r\nPull requests and issues are welcome!  \r\nCheck out the [issues page](https://github.com/cappern/node-red-dashboard-2-oauth2-auth/issues).\r\n","readmeFilename":"README.md"}