Commit Graph

18 Commits

Author SHA1 Message Date
Deepak Prabhakara a473b360ef
New OIDC fed (#2336)
* add WellKnownURLs

* Fix translation keys

* Update dependencies and add IdP Configuration

* Update common.json with new translations

* wip

* Update @boxyhq/internal-ui version to 0.0.5

* add internal ui folder

* Fix imports and build

* Refactor internal-ui package structure

* wip shared UI

* Fix the build

* WIP

* Add new components and hooks for directory sync

* WIP

* lint fix

* updated swr

* WIP

* users

* Refactor shared components and fix API endpoints***

***Update directory user page and add new federated SAML app

* Fix lint

* wip

* Add new files and update existing files

* Refactor DirectoryGroups and DirectoryInfo components

* Update localization strings for directory UI

* Update Google Auth URL description in common.json

* Refactor directory tab and add delete functionality to webhook logs

* IdP selection screen changes

* Delete unused files and update dependencies

* Fix column declaration

* Add internal-ui/dist to .gitignore

* Update page limit and add new dependencies

* wip

* Refactor directory search in user API endpoint

* wip

* Refactor directory retrieval logic in user and group API handlers

* Add API endpoints for retrieving webhook events

* check app's redirectUrl, TODO: save app info into session to read later

* Add query parameters to API URLs in DirectoryGroups

* working saml login via IdP select. TODO: oidc login via IdP select and saml + oidc login with 1 connection

* oidc IdP working with selection

* working oidc fed -> saml flow

* Add Google authorization status badge and handle pagination in FederatedSAMLApps

* Add router prop to AppsList component and update page header titles

* UI changes

* updated peer-deps

* Add new files and export functions

* Remove unused router prop

* Add PencilIcon to FederatedSAMLApps

* updated federated app creation page

* updated federated app edit page

* Refactor FederatedSAMLApps and NewFederatedSAMLApp components

* lint fix

* lint fix

* updated package-lock

* add jose npm to dev dep

* added missing strings

* added missing strings

* locale strings fix

* locale strings cleanup

* tweaks to icon imports

* replaced textarea with list of inputs for Federated Apps redirect url

* update package-lock

* Add prepublish step

* Build and publish npm and internal ui

* Refactor install step

* Run npm install (for local) inside internal ui automatically using prepare

* Remove eslint setup for internal-ui

* updated package-lock

* Add `--legacy-peer-deps` to prevent installing peer dependencies

* Fix the types import path

* wip

* wip

* Fix the types

* Format

* Update package-lock

* Cleanup

* Try adding jose library version 5.2.2

* allow selective subdomain globbing

* removed duplicate jose lib

* updated package-lock

* updated swagger doc

* SAML Federation -> Identity Federation

* fixed locale strings

* turn off autocomplete for tags input

---------

Co-authored-by: Kiran K <mailtokirankk@gmail.com>
Co-authored-by: Aswin V <vaswin91@gmail.com>
2024-03-05 16:57:02 +00:00
Kiran K 1a9af89110
Add `sortOrder` to sso connection to control the order of connections (#2231)
* Control the order of connections in the IdP selection list

* Remove unused import statement

* Fix the sortOrder

* Type fix

* Fix TS error

* Fix build

* Update API version and add sortOrder parameter

* Update swagger specs

* Update swagger

* Add tests

* Add `sortOrder` to GET spec

* Refactor connection retrieval logic and add sorting option

* Fix connection sorting issue

* Fix connection sorting issue

* Update the validation

* Fix the tests

* Filter out connections that are not enabled

---------

Co-authored-by: Aswin V <vaswin91@gmail.com>
Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2024-02-08 15:14:14 +00:00
Kiran K 7103d61967
Add support for associating multiple tenants in SAML federated apps (#2214)
* Add support for associating multiple tenants in SAML federated apps

* Add tenants input field to edit and new pages

* Refactor

* Add support for filtering connections by multiple tenants

* Update global CSS styles for react-tagsinput

* Update border-radius for react-tagsinput

* Refactor CSS styles for react-tagsinput

* Update the tenants array

* Cleanup tenants assignment
2024-01-31 09:11:46 +00:00
Aswin V c0bd0b5eb0
Tweak branding logo rendering (#2171)
* Remove width/height and set max-height

* Sync lock file

* Increase max-height for idp select

* Tweak branding_logo_url_alt

* Minor text tweak

* text tweak

---------

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2024-01-18 21:24:52 +00:00
Kiran K 70abbc8ee4
Support product branding (EE) (#2110)
* Make entity ID read-only

* Update swagger.json

* Add validation to check if an app with the same tenant and product already exists

* Fix error message for duplicate app creation

* Update API handler to use PATCH method instead of POST

* Add product branding support

* Refactor product controller

* Refactor branding and product fetching logic

* Update setup link branding

* Revert

* Fix ProductConfig interface
2024-01-02 15:00:41 +00:00
Kiran K fde4e59fa6
Add missing translations (#2089)
* Add missing translations

* Add eslint-plugin-i18next plugin

* Add missing translation

* Update translations

* Update ESLint rules and improve UI text

* Update WellKnownURLs locales

* Add server-side translations in SetupLinkIndexPage
2023-12-27 12:21:53 +00:00
Deepak Prabhakara 1525035092
updated daisyui (#2088)
* updated daisyui

* Update color conversion function

* Update color conversion function

---------

Co-authored-by: Kiran K <mailtokirankk@gmail.com>
2023-12-26 12:07:34 +00:00
Kiran K f32ac6aecb
Store product config (#1952)
* Store product config

* Handle Product not found.

* Product id is required

* Cleanup

* Refactor API route validation in middleware.ts

* Show friendly product name instead of id

* Refactor product fetching
2023-11-24 16:35:20 +00:00
Kiran K 8d9a532a68
IdP screen - Warn the user when refresh the page (#1821)
* Idp screen - Warn user when refresh the page

* Validate authFlow

* Handle invalid params

* Tweak
2023-10-23 10:24:18 +01:00
Kiran K 24a2927346
Add `/api/v1/federated-saml` endpoints (#1671)
* Get Federated SAML apps by product

* move to /ee

* Rename method

* Fix APIs

* delete app by tenant + product

* get app by tenant and product

* Fix the params

* Fix the params

* Change API path to /saml-federation

* Update the paths

* use /federated-saml

* Revert

* Add swagger specs

* Fix tests
2023-10-04 13:07:46 +01:00
Deepak Prabhakara 2d4a47ca49
minor tweaks (#1254)
* minor tweaks

* Template literals coerce their expressions directly to strings

* tweak
2023-06-28 18:43:37 +01:00
Kiran K 224358df28
Ability to customize the branding of Setup Link pages and the IdP selection pages (ee) (#965)
* display toast and adjust the width of the content

* customize the branding for setup links

* use the branding in setup links page

* Admin Branding WIP

* Update settings

* Move to ee folder

* If the licence is not valid, return the default branding

* update translation

* Add logo to the idp selection page

* add license check to the API

* read default branding from a common place

* add LicenseRequired

* cleanup

* Add License check to NPM

* Fix

* Add --pf css variable

* fix the idp selection page

* use default branding if value is not set

* Fixes

* Improved the store and keys

* Infer the return type

* Whitelabeling the IdP selection screen per tenant and product

* Fix the param type

* Fix the unit tests

* Fix mismatch in server/client rendering

* Switch to radio button look and feel

* Use rounded border only for textual inputs

* Cleanup import

* Move routing to `useEffect`

* Fix server render mismatch

* fixed merge conflict

* fixed merge conflict

---------

Co-authored-by: Aswin V <vaswin91@gmail.com>
Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2023-03-09 14:50:25 +00:00
Kiran K 7287a6bb37
Federated SAML (#685)
* Add alert component

* Add a loading state component

* Now Emptystate accept an optional prop description

* SAML federation create app controller

* Add the UI to create and list SAML federation apps

* Create SAML federation app and metadata

* wip

* wip

* wip

* Cleanup

* Fix the return values

* Delete the session after the SAML response is sent to the user

* wip

* Revert the changes to the ConnectionAPIController

* wip - IdP selection, session fixes

* Fix the flow

* Refactor

* Refactor

* wip

* Refactor the idp selection page - wip

* Refactor

* Refactor the resolve connection

* Refactor the idp selection

* Refactor the idp/app selection and other fixes

* wip

* Refactor

* Refactor the SAML response handling to merge the logic

* Rename the methods

* Move the saml federation to /ee folder

* Fix the imported types

* wip

* wip /ee

* Move the federated SAML UI to /ee

* Move to /ee folder

* wip admin portal

* Delete the SAML federation app

* Rename the controllers

* Add the translation

* Add the proper license check

* Add the unit tests

* tweaks to test

* tweaks to test

* Changes to the controller and other cleanup

* Fix API routes headers

* Use new toast

* Add button to download cert

* Tweaks

* log cleanup

* saml federation is part of enterprise sso

* entityID now contains the unique hash needed for each tenant + product combination

* cleanup

* cleanup

* we don't need a unique entityID

* text tweaks

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-12-16 15:38:59 +00:00
Utkarsh Mehta 6e5e804d38
Setup Link Feature (#628)
* Share setup link related changes
1. Setup link creation for saml connection
2. Setup link creation for Directory sync
3. Regeneration of Setup link
4. Ability to open setup link without login
5. Setup link opens up SAML connection page
6. Saml Connection page hides Tenant & Product fields

* Saving SAML and OIDC configuration

* showing the connection list on setup page

* Connections CRUD

* UI changes for Setup layout

* semantics changes connection ->  sso-connection

* directory sync support for share link

* showing only current tenant product directories

* fixes mentioned in commnets by Aswin

* prettier formatting

* fixed route

* minor fixes

* Fix the layout rendering for the /setup routes

* minor fixes

* review changes

* package lock changes

* package json and lock changes

* removed xmlbuilder

* package lock changes

* removed api call from ConnectionList component

* Back button link fix

* intermediate changes for Setup link list feature

* setup link list related changes

* UI fixes and actions

* removed unwanted import

* setup link list action hooked with correct functions

* path rewrites, styling changes, toast
regenerate & delete setup links

* fixes for mutate

* minor tweaks to clipboard icon

* updated package-lock

* formatting changes

* removed console log

* Added cusor pointer for action for LinkList component
Removed unused variable & validation of empty token
Removed redundent validation code
linting fixes

* Auto redirect in setup link page for sso-connection create form
Delete icon on setup link list page on hover red color & tooltips

* removed redirect and used isValidating

* fixes for router replace

* toast for setup links

* fixes for dsync apis

* redirect related change

* removing redirect for sso-connection

* fallback to error.message

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
Co-authored-by: Kiran <kiran@boxyhq.com>
2022-12-13 21:41:27 +00:00
gitstart-boxyhq 4ce126714a
Internationalization (i18n): Add remaining translation strings (#673)
Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com>
Co-authored-by: gitstart-boxyhq <gitstart@users.noreply.github.com>
Co-authored-by: Matheus Benini <matheus_benini@hotmail.com>
Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev>
Co-authored-by: gitstart-boxyhq <boxyhq@gitstart.com>

Co-authored-by: gitstart-boxyhq <gitstart@users.noreply.github.com>
Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com>
Co-authored-by: Matheus Benini <matheus_benini@hotmail.com>
Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev>
Co-authored-by: Kiran K <kiran@boxyhq.com>
2022-11-15 10:59:37 +05:30
Aswin V a12d4ef85d
Fix IdP-Select screen connection label (#633)
* Use connection name along with provider

* Sync package locks
2022-10-27 14:02:14 +01:00
Aswin V d5cbb40d91
Support for OIDC Identity Providers (#385)
* Support connection dynamic param in route

* Pass `connection`

* Fix tests

* Accept oidc params and validate the same

* Rename `connection` --> `strategy`

* Use saml for preLoadedConfig for now

* Rename `apiController` --> `apiConfigController`

* Flatten the params

* Validate passed config

* Backward compatibility for embed setup

* Impl for oidc config save

* index addition for oidc clientId

* Remove param, defaults to saml

* Validation will be done inside controller

* Zap secondary index on clientId, not required

* Rename `APIConfigController` --> `ConfigAPIController`

* Update swagger

* Fix name

* Fix name elsewhere

* Revert filter

* Split `saml` and `oidc` create/update logic

* Route `saml` and `oidc`

* Test update

* Update swagger

* Update swagger

* Use tenant/product from stored config
in lieu of params

* Validate passed OIDC clientId using hash

* Update swagger annotations

* Handlers for getting OIDC/SAML configs

* Validate tenant/product in update

* Typo fix

* Fix test

* Default to empty string, validation is done
to check if the params are not empty

* Extract provider name just like saml

* OIDC Connection support
*delta for authorize*
- Renamed samlConfig(s) → connection(s)
- Renamed resolvedSamlConfig -> resolvedConnection
- Detect connection is SAML or OIDC
- Perform Issuer discovery and oidc client init
- Tweak error responses
- Persist oidc client metadata in session

* Test type fix

* Test fix

* openid-client dependency

* Sync package locks

* Fix return type
- Remove `undefined` from return type
- Return `OAuthErrorResponse` for else case

* Handle OIDC Authorization response

* Persist OIDC code_verifier

* Remove scope check for OIDC connection

* Normalize scope before relaying

* Method name update

* Extract user profile from id token and userinfo

* Handle error response from OIDC Provider

* Update type

* Type update with OIDC specific error codes

* Bug fix : typo

* Cleanup

* OIDC callback route

* Bug fix: return profile and parameter fix

* Rename `config` -> `connection`

* Use `Link` and add oidc connection nav item

* Use `strategy` from query param

* Delta ↴
 - Reorganised api routes
 - Removed Admin controller filtering methods for saml/oidc

* Fix page link in e2e test

* Changes:
 - Handle oidc connection fields
 - Rename component file path

* Remove slug for save/update connection

* Fix keyname in update operation

* Import path update

* Radio select connection type for new connection

* Update lock file

* Sync lock file

* Sync package lock

* Fix connectionType detection for new connection

* Fix error message

* Add comment

* Tweak comment

* Use the correct state and directly from session

* Sync lock file

* Remove `provider` from OAuthReqBody

* Remove duplicate scopes

* Pass recent param additions to idpSelection page

* Add badge for Provider type

* Style tweak

* Style IdP type selection

* Add test for oidc provider

* Comment

* Check for empty state

* Add test for oidcAuthzResponse

* Add test for oidcAuthzResponse

* Add test for error response from OP

* Error message tweak

* Test the happy path

* Remove unused import

* Fix assertion

* - Fix types
- add createOIDCConfig` test for missing params

* Test happy path for `createOIDCConfig`

* Param validation tests for `createOIDCConfig`

* Test for `updateOIDCConfig`

* Tests for `updateOIDCConfig`

* Male `oidcPath` required like `samlPath`

* Bump `openid-client` version

* Refactor

* Update test coverage map

* Tweak label

* Split openid/oauth tests

* call `t.end`

* Fix file name in comment

* Add test teardown

* Improve coverage and rename test files

* For backwards compatibility

* Minor formatting

* Add api paths for /connection

* Zap config path for admin ui

* Update swagger spec

* Rename `configAPIController`
→ `connectionAPIController`

* Rename `IdPConfig` → `IdPConnection`

* Rename `validateIdPConfig` → `validateIdPConnection`

* Rename `createSAMLConfig` → `createSAMLConnection`

* Rename `createOIDCConfig` → `createOIDCConnection`

* Update swagger spec

* Rename `updateSAMLConfig` → `updateSAMLConnection`,
 `updateOIDCConfig` → `updateOIDCConnection`

* Make `clientID`/`clientSecret` readOnly

* Rename `configStore` → `connectionStore`

* Update swagger spec

* Add `getConnection` + `deleteConnection`

* Remove `/api/v1/oidc/config`
and keep `api/v1/saml/config`

* Rename `getAllConfig` → `getAllConnection`

* Rename `readConfig` → `loadConnection`

* Rename `deleteConfiguration` → `deleteConnection`

* Add `preLoadedConnection` env

* Update map and cli

* Refactor api tests and rename config to connection

* Rename `configList` → `connectionList`

* Rename `samlConfig` → `samlConnection`

* Rename config -> connection

* Rename `config` → `connection`

* Rename counters for otl

* Sync package lock

* Remove api key validation from api route

* Update Admin ui title

* Update swagger

* Update otl metric descriptions

* Update var naming to connection

* Add strategy validation

* Add tests for invalid strategy

* Sync package lock

* Upgrade and pin version

* Update saml config api with deprecated

* Updated swagger spec for deprecated config api

* Bump package version

* Fix label

* - removed strategy for `get` and `delete`
 - Type update

* Type updates

* getConnection -> getConnections,
deleteConnection -> deleteConnections

* Update swagger spec

* Use only for saml connection

* Remove slug from api routes

* API path updates

* Type updates

* Helper util for api routes to check strategy

* Type updates and api changes

* `OAuthReq` typings enhancement

* Narrowed down types for `OAuthTokenReq` and
`OIDCAuthzResponsePayload`

* `IdPConnection` -> `SSOConnection`

* Update cookie name to avoid clash

* Handle the uncaught case to prevent req hanging
2022-09-30 11:37:21 +01:00
Aswin V 7ae34e47d1
Support multiple config matches for a single tenant/product (#149)
* IdP selection page

* Add idpDiscoveryPath option

* Generalise redirection logic

* Handle redirect_to_idp_select

* Support for array value [idpList]

* Implement redirection to IdP selection page

* remove redirect_to_idp_select

* Filter our undefined values

* Remove returnTo

* Check if idpDiscovery is enabled

* Cleanup

* Basic layout plus styling

* Add idpDiscoveryPath to env

* Package lock changes

* Simplify empty handling

* Rename to idp_hint

* refactor

* Pass along idp_hint in requested

* Switch from form to link

* Check and set requested

* Tenant/product should be optional

* Fix condition

* App selection for IdP flow

* cleanup

* Pin version

* updated to saml20 v1.0.1

* Latest lock file

* Use generic createPostForm from saml20

* Style alignment

* Style name and description

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2022-04-29 16:51:03 +01:00