-
Notifications
You must be signed in to change notification settings - Fork 8
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
Comments
A question about this issue : Is this behavior expected or desired ? |
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 :) |
Ok, I understand. Next, 2 questions come to my mind :
|
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 :
A user tries to log on with ProConnect (in my case, only SIRET field exists about organization)
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.
account.getOrg()
return""
)georchestra-gateway/gateway/src/main/java/org/georchestra/gateway/accounts/admin/ldap/LdapAccountsManager.java
Line 97 in 94bb76b
georchestra-gateway/gateway/src/main/java/org/georchestra/gateway/accounts/admin/ldap/LdapAccountsManager.java
Line 107 in 94bb76b
georchestra-gateway/gateway/src/main/java/org/georchestra/gateway/accounts/admin/ldap/LdapAccountsManager.java
Line 180 in 94bb76b
From console, admin can observe this new user (not pending by default) without any org
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.
The text was updated successfully, but these errors were encountered: