zorn-v / nextcloud-social-login

GNU Affero General Public License v3.0
198 stars 137 forks source link

User timezone not set at connection #408

Closed freesuitware closed 11 months ago

freesuitware commented 1 year ago

Good morning,

With @ThibautPlg We are using Social login to connect to a Keycloak instance that auto create users at their connection and everything is working as we wished. Thanks for that. Yet, we do face one issue which seems to be related to OpenID. The users connection is used by Nextcloud to define timezone for which is done by an entry in the user table oc_preferences: appid = 'core' and configkey = 'timezone'.

When connecting via SSO, this saving operation seems to not occur, but when connection with local connection it does save the timezone as expected.

We are currently not sure if we can use the Keycloak to provide this information so we would like to know if it could be possible to implement a behavior in which SocialLogin would set the user browser timezone as user timezone if the latter is not provided by the authentication provider?

Let us know if we can provide some information to help with this.

Regards.

zorn-v commented 1 year ago

I don't think it is good idea to link such special case in "general way" How much users need it ? How much providers provide TZ information ?

ThibautPlg commented 1 year ago

It's not really about providers. In the regular Nextcloud login workflow, at some point, Nextcloud gets the browser timezone and pass it to the back to be stored in the oc_preferences table. Thanks to that, at every login it's updated, and if I travel around the globe my Nextcloud timezone is updated (which has an impact in mails and display in the interface).

When connecting to NC using social-login, the same process isn't applied and my timezone fallback to the server one. This is a problem when using Nextcloud in countries with multiple timezone.

Some providers may also provide the timezone but that's - I think - not the best way to address our problem, as we should at least fallback to the regular NC behaviour.

Regards,

zorn-v commented 1 year ago

When connecting to NC using social-login, the same process isn't applied and my timezone fallback to the server one. This is a problem when using Nextcloud in countries with multiple timezone.

Social login is not that app which resolve "many timezones"

freesuitware commented 1 year ago

Hello, You are right: Social Login is not meant to do that but Nextcloud does it. That's why the suggestion was to call the Nextcloud local account behavior regarding this timezone setting. It might no be as simple as we express it, but that's the idea.

We are willing to work with you on it if that make sense to you.

zorn-v commented 1 year ago

Later...

freesuitware commented 11 months ago

Hello,

After some testing with Nextcloud 27, it seems the timezone is set when user are connected via Social Login. We don't know what explains this, but we can consider the issue solved.

Regards.