[PR #491] [MERGED] Add Authorization code flow with pkce and exchange the token. #1150

Open
opened 2025-10-09 19:09:49 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/plankanban/planka/pull/491
Author: @gorrilla10101
Created: 8/11/2023
Status: Merged
Merged: 9/4/2023
Merged by: @meltyshev

Base: masterHead: add-oidc-support


📝 Commits (10+)

📊 Changes

25 files changed (+806 additions, -24 deletions)

View changed files

📝 client/package-lock.json (+54 -0)
📝 client/package.json (+1 -0)
📝 client/src/api/access-tokens.js (+3 -0)
📝 client/src/components/Header/Header.jsx (+8 -1)
📝 client/src/components/Login/Login.jsx (+5 -0)
client/src/components/OIDC/OidcLogin.jsx (+19 -0)
client/src/components/OIDC/index.js (+3 -0)
📝 client/src/components/Root.jsx (+27 -15)
📝 client/src/constants/Paths.js (+2 -0)
client/src/containers/OidcLoginContainer.js (+26 -0)
📝 client/src/index.js (+7 -3)
📝 client/src/locales/cs/core.js (+1 -2)
📝 client/src/sagas/login/services/login.js (+6 -2)
server/api/controllers/access-tokens/exchange.js (+177 -0)
server/api/controllers/appconfig/index.js (+11 -0)
server/api/models/IdentityProviderUser.js (+40 -0)
📝 server/api/models/User.js (+8 -1)
📝 server/config/custom.js (+10 -0)
📝 server/config/policies.js (+2 -0)
📝 server/config/routes.js (+3 -0)

...and 5 more files

📄 Description

uses react-oidc-context to login to an OIDC Provider and then exchanges that access token for a planka token.

I addressed, all of the concerns from this PR that I noticed. https://github.com/plankanban/planka/pull/203

  1. user table has a locked column now, though it is currently unused.
  2. password is nullable
  3. separate table to hold SSO identifiers. Will allow for multiple sign on and could be expanded to facilitate integrations
  4. exchange api that swaps the access token for one generated by planka.
  5. calls a config endpoint to get the oidc config settings

There's one big thing and a couple small thing that I know of remaining.

  1. The only place I could find to make the config settings calls was in the index.js file before the react app. While this works, it seems sketchy.
  2. Configuration to allow the text to be changed
  3. Whatever advice/suggestions to improve the situation.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/plankanban/planka/pull/491 **Author:** [@gorrilla10101](https://github.com/gorrilla10101) **Created:** 8/11/2023 **Status:** ✅ Merged **Merged:** 9/4/2023 **Merged by:** [@meltyshev](https://github.com/meltyshev) **Base:** `master` ← **Head:** `add-oidc-support` --- ### 📝 Commits (10+) - [`c9d1a14`](https://github.com/plankanban/planka/commit/c9d1a140447897b2eaabe7beda13bbade84b0fa4) installed react-oidc - [`5e84e0a`](https://github.com/plankanban/planka/commit/5e84e0a76f3f026bf015efac0909cd83d31e14a3) add openid-client package - [`5bff084`](https://github.com/plankanban/planka/commit/5bff0840ee43f6aaf9a061b0e05f4f22ca38325f) frontend ui configured. - [`07e8b4e`](https://github.com/plankanban/planka/commit/07e8b4ec6bfc358dd6cd62509b3b5d35f57c20c8) initial login with oidc - [`630dc09`](https://github.com/plankanban/planka/commit/630dc0976ee68116d15f8aa88811dd25edcd98d0) logout - [`8f13411`](https://github.com/plankanban/planka/commit/8f13411ca001ab836c322325c00c7738d14e8370) loaded config from server - [`f2536c6`](https://github.com/plankanban/planka/commit/f2536c6bb79f71ff9c7ceeb7295fb8ba265243be) switched to react-oidc-context - [`f08626a`](https://github.com/plankanban/planka/commit/f08626acb7c7cf0bb52ca9da35bff7868eab2d5b) Button for login. - [`827e51a`](https://github.com/plankanban/planka/commit/827e51a59084e035f8d5569484ec76665e5638fe) Created IdentityProviderUser - [`5385020`](https://github.com/plankanban/planka/commit/53850201a11b7e833fdd10ce309146f3428f29ed) - created identity_provider_user table ### 📊 Changes **25 files changed** (+806 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `client/package-lock.json` (+54 -0) 📝 `client/package.json` (+1 -0) 📝 `client/src/api/access-tokens.js` (+3 -0) 📝 `client/src/components/Header/Header.jsx` (+8 -1) 📝 `client/src/components/Login/Login.jsx` (+5 -0) ➕ `client/src/components/OIDC/OidcLogin.jsx` (+19 -0) ➕ `client/src/components/OIDC/index.js` (+3 -0) 📝 `client/src/components/Root.jsx` (+27 -15) 📝 `client/src/constants/Paths.js` (+2 -0) ➕ `client/src/containers/OidcLoginContainer.js` (+26 -0) 📝 `client/src/index.js` (+7 -3) 📝 `client/src/locales/cs/core.js` (+1 -2) 📝 `client/src/sagas/login/services/login.js` (+6 -2) ➕ `server/api/controllers/access-tokens/exchange.js` (+177 -0) ➕ `server/api/controllers/appconfig/index.js` (+11 -0) ➕ `server/api/models/IdentityProviderUser.js` (+40 -0) 📝 `server/api/models/User.js` (+8 -1) 📝 `server/config/custom.js` (+10 -0) 📝 `server/config/policies.js` (+2 -0) 📝 `server/config/routes.js` (+3 -0) _...and 5 more files_ </details> ### 📄 Description uses react-oidc-context to login to an OIDC Provider and then exchanges that access token for a planka token. I addressed, all of the concerns from this PR that I noticed. https://github.com/plankanban/planka/pull/203 1. user table has a locked column now, though it is currently unused. 2. password is nullable 3. separate table to hold SSO identifiers. Will allow for multiple sign on and could be expanded to facilitate integrations 4. exchange api that swaps the access token for one generated by planka. 5. calls a config endpoint to get the oidc config settings There's one big thing and a couple small thing that I know of remaining. 1. The only place I could find to make the config settings calls was in the index.js file before the react app. While this works, it seems sketchy. 2. Configuration to allow the text to be changed 3. Whatever advice/suggestions to improve the situation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-09 19:09:49 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#1150