Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable and update user forms if OIDC is enabled #2859

Merged
merged 9 commits into from
Aug 6, 2024

Conversation

arbulu89
Copy link
Contributor

@arbulu89 arbulu89 commented Aug 5, 2024

Description

Disable certain fields and options in user management views if SSO (OIDC in this case) is enabled.
The /users/new url is redirected to not found.

image

image

How was this tested?

Tested with jest and storybook

@arbulu89 arbulu89 added the enhancement New feature or request label Aug 5, 2024
@arbulu89 arbulu89 changed the title Disable forms sso frontend Disable and update user forms if OIDC is enabled Aug 5, 2024
@arbulu89 arbulu89 marked this pull request as ready for review August 6, 2024 07:35
@arbulu89 arbulu89 requested review from EMaksy and CDimonaco August 6, 2024 07:37
Copy link
Member

@CDimonaco CDimonaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect 🚀

Just one nitpick but really up to you, one I commented on the code, about moving the oidc app configuration stuff from model/users to @lib/auth in a dedicate file

assets/js/lib/model/users.js Outdated Show resolved Hide resolved
@@ -25,6 +25,7 @@ function ProfileForm({
disableForm,
passwordModalOpen = false,
totpBoxOpen = false,
singleSignOnEnabled = false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick(naming): Maybe, from the ProfileForm perspective, it doesn't matter if the SSO is enabled or something. The only thing it needs to know is whether it is editable. We may want to rename this flag as readonly, but it's really nitpicking.‏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need it to make the difference between actual editing enabled (which now is nambed disableForm, but still shows the password and topt button) and sso option, which doesn't show the fields.

@arbulu89 arbulu89 force-pushed the disable-forms-sso-frontend branch from d8a42e6 to c6e5dc5 Compare August 6, 2024 09:45
@arbulu89 arbulu89 force-pushed the disable-forms-sso-frontend branch from c6e5dc5 to 42445db Compare August 6, 2024 09:53
@arbulu89 arbulu89 changed the base branch from main to oidc August 6, 2024 09:53
@arbulu89 arbulu89 merged commit 1053657 into oidc Aug 6, 2024
25 of 26 checks passed
@arbulu89 arbulu89 deleted the disable-forms-sso-frontend branch August 6, 2024 12:10
CDimonaco pushed a commit that referenced this pull request Aug 12, 2024
* Send oicd is enabled value to frontend

* Create users function to check sso is enabled

* Add sso differences in the users views

* Add sso differences in profile views

* Disable password update requested notification

* Correct typo and remove test debug

* Move sso auth logic to auth folder

* Format mix.exs file

* Disable oidc by default in dev
EMaksy pushed a commit that referenced this pull request Aug 19, 2024
* Send oicd is enabled value to frontend

* Create users function to check sso is enabled

* Add sso differences in the users views

* Add sso differences in profile views

* Disable password update requested notification

* Correct typo and remove test debug

* Move sso auth logic to auth folder

* Format mix.exs file

* Disable oidc by default in dev
arbulu89 added a commit that referenced this pull request Aug 20, 2024
* Configured local keycloak with realm provisioning

* Installation and first configuration of pow-assent

* Keycloak provisioned realm confidential

* frontend wip

* oidc callback as conf parameter

* locked users could not login through IDP

* Delete user deletes user identities

* User identity changeset to map oidc standard to user schema

* Add session controller callback test

* Disable and update user forms if OIDC is enabled (#2859)

* Send oicd is enabled value to frontend

* Create users function to check sso is enabled

* Add sso differences in the users views

* Add sso differences in profile views

* Disable password update requested notification

* Correct typo and remove test debug

* Move sso auth logic to auth folder

* Format mix.exs file

* Disable oidc by default in dev

* Disable actions when external idp is enabled (#2863)

* Add external idp guard plug

* Prevent write profile operations when external idp is configured

* Prevent traditional login operation when external idp is configured

* Disable create user endpoint when external idp is configured

* fix controller tests env

* mix credo

* Addressing review feedback

* dialyzer fix

* View field for idp users (#2865)

* Listing and getting users returns also the user identities

* User controller returns idp_user field in response

* profile controller returning idp_user field

* Create user adds empty user_identities

* User identities context assigns global abilities to a oidc user (#2868)

* Single sign on login view (#2866)

* Load oidc url in frontend

* Create SSO login view

* Improve frontend OIDC callback (#2871)

* Send oidc callback url to frontend

* Get oidc callback url in frontend functions

* Refactor and test oidc enrollment saga

* Refactor and test oidc callback component

* Allow only abilities update with OIDC (#2879)

* User update endpoint only updates abilities when oidc enabled

* User update skips password changeset if the user comes from idp

* Allow enable field in users update when oidc is enabled

* mix credo

* Add option to load oidc variables in runtime (#2874)

* Existing user is recovered when login with oidc (#2880)

* Existing user is recovered when login with oidc

* Addressing review feedbacks

* Fix fullname entry in trento console for a new created user by idp provider (#2883)

* fix typo

* Use name to display the full name in trento not only the first name

* fix oidc callback url parameter in oidc runtime (#2906)

* OIDC integration E2E  tests (#2908)

* Add admin user to keycloak trento realm

* Add OIDC integration e2e tests

* Run integration test conditionally

* Add github action to run integration test

---------

Co-authored-by: Carmine Di Monaco <[email protected]>
Co-authored-by: Carmine Di Monaco <[email protected]>
Co-authored-by: Eugen Maksymenko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants