TheHive-Project / Cortex

Cortex: a Powerful Observable Analysis and Active Response Engine
https://strangebee.com/cortex/
GNU Affero General Public License v3.0
1.34k stars 229 forks source link

autoupdate = false not take effect #345

Open rleal124 opened 3 years ago

rleal124 commented 3 years ago

Hi all,

I ahve the oauth2 configure in order to do not autoupdate the role and profile and disable the auto login.

Autoupdate its profile and roles?

autoupdate = false or autoupdate = "false"

Autologin user using SSO?

autologin = false or autologin = "false"

The problem I see, the cortex keep updating the user profiles and roles, Also I see the below message:

[DEBUG] from org.thp.cortex.services.OAuth2Srv in application-akka.actor.default-dispatcher-15 - Updating OAuth/OIDC user

Can please help?

P1514 commented 3 years ago

We found that autoupdate and autocreate are switched in behaviour.

If we set autoupdate to false or comment no new users are created If we set autocreate to false users are no longer updated.

Anyone else experiencing this issue?

masdeeper commented 3 years ago

We have same issue with autoupdate, by setting autocreate to false instead, it works now.

vaclavbartos commented 1 year ago

Yes, I looked at source codes and it seems to be switched, indeed. I think the fix will be easy - just swap lines 28,29 (or 59,60) in OAuth2Srv.scala. However, I've never wrote anything in Scala and don't even know how to compile and test it, so I'm rather not making a pull request. If there's anyone who can test it, please do so.