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

Create user without organization seems possible #172

Open
Gaetanbrl opened this issue Jan 30, 2025 · 3 comments
Open

Create user without organization seems possible #172

Gaetanbrl opened this issue Jan 30, 2025 · 3 comments

Comments

@Gaetanbrl
Copy link

Gaetanbrl commented Jan 30, 2025

In the Gateway, it seems possible to create a user without organization.

If a user is create from console ou register page, a default organization is used.
But with OAuth2, a user without org field can be created.

Here steps and my understanding :

  1. A user tries to log on with ProConnect (in my case, only SIRET field exists about organization)

  2. At the Claims mapping steps, the org is mapped according to claims gateway config.

https://github.com/georchestra/georchestra-gateway/blob/main/gateway/src/main/java/org/georchestra/gateway/security/oauth2/OpenIdConnectUserMapper.java#L178

But this is not required. So we haven't made any changes to the configuration.

  1. A new account is create (account.getOrg() return "")

Image

  1. Next, gateway search Organization (fin or create) but finally do nothing without organization.

  1. From console, admin can observe this new user (not pending by default) without any org

  2. If I change gateway/security.yaml config file, the gateway map org id correctly and will create org + insert this new user in this new org.

With this case, a user is create without any organization. This is not consistent with what the console / register page seems allow.

Therefore, this case should probably not be possible if organization is correctly mapped / configured from YAML.

Maybe i'm wrong, but this case seems really possible and organization appear as not required.

@Gaetanbrl Gaetanbrl changed the title Create user without Org Create user without organization seems possible Jan 30, 2025
@Gaetanbrl
Copy link
Author

Gaetanbrl commented Jan 30, 2025

With this case, a user is create without any organization. This is not consistent with what the console / register page seems allow.

A question about this issue :

Is this behavior expected or desired ?

@landryb
Copy link
Member

landryb commented Jan 30, 2025

im not sure its expected/desired, but so far in the user console, you can 'detach' an ldap/local user from an org (eg the user isn't attached to any org) and you can save the user without having a warning/error. so far, and to my understanding, the code doesn't enforce an ldap/local user being linked to an org. so here oauth aligns with that behaviour.

depending on platform account policies, one might want to enforce it or not, so at least having it configurable is desirable :)

@Gaetanbrl
Copy link
Author

Gaetanbrl commented Jan 30, 2025

Ok, I understand.

Next, 2 questions come to my mind :

  • This configuration is maybe not the best way to force the link user <> org. This config is usefull to map not standard claims <> georchestra infos (only org id / roles / user id). I suppose that a (new) dedicated configuration should be used to force (or not) this link according to plateform policies.

  • (another topic ?) This configuration seems concerns all the gateway behavior because custom claims config have to be set in georchestra.gateway.security.oidc.claims level. Several providers can have different mapping (imagine use ProConnect, FranceConnect or other.. at the same time). I don't see how to customize claims by provider with the current configuration. But I'm maybe wrong. See Claims mapping limitation #176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants