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

Exposed leeway setting in the JWT library #729

Merged
merged 2 commits into from
Feb 25, 2023

Conversation

anon8675309
Copy link

If the system clock of the document server is even a second slower than the nextcloud server, the JWT token will be rejected as being "not yet valid". This can be seen in the logs (Nextcloud -> Settings -> Administration -> Logging).

The error message shown to the user when this happens is more generic:

"Error when trying to connect (Error occurred in the document service: Error while downloading the document file to be converted.)"

This error message has been reported on the bug tracker several times, but it is not clear when the connection failure was due to imperfectly synchronized clocks and when it was due to network connectivity, DNS issues, the JWT not being sent, the secret being wrong, or some other issue.

Here are the tickets that may be fixed by this:
#345 #548 #315 #290 #127

There's also one on the owncloud fork that may be fixed by this as well: ONLYOFFICE/onlyoffice-owncloud#278

If the system clock of the document server is even a second slower than the
nextcloud server, the JWT token will be rejected as being "not yet valid". This
can be seen in the logs (Nextcloud -> Settings -> Administration -> Logging).

The error message shown to the user when this happens is more generic:

"Error when trying to connect (Error occurred in the document service: Error
while downloading the document file to be converted.)"

This error message has been reported on the bug tracker several times, but it is
not clear when the connection failure was due to imperfectly synchronized clocks
and when it was due to network connectivity, DNS issues, the JWT not being sent,
the secret being wrong, or some other issue.

Here are the tickets that may be fixed by this:
ONLYOFFICE#345
ONLYOFFICE#548
ONLYOFFICE#315
ONLYOFFICE#290
ONLYOFFICE#127

There's also one on the owncloud fork that may be fixed by this as well:
ONLYOFFICE/onlyoffice-owncloud#278
@CLAassistant
Copy link

CLAassistant commented Oct 25, 2022

CLA assistant check
All committers have signed the CLA.

@anon8675309
Copy link
Author

Is there anything I can do to help get this merged into the default branch?

@anon8675309
Copy link
Author

I've pulled in the changes from the default branch so this can be merged cleanly

@anon8675309
Copy link
Author

@LinneyS is this change something that can be upstreamed into the official repo?

@anon8675309
Copy link
Author

In case the onlyoffice-nextcloud app is still maintained, please accept this merge request.

However, since it's been several months and this pull request hasn't been merged or commented on, I have to conclude that onlyoffic-nextcloud is now unmaintained. This will be my last follow up unless I get a notification about activity from github.com.

@LinneyS LinneyS changed the base branch from master to develop February 24, 2023 13:48
@LinneyS LinneyS added the enhancement New feature or request label Feb 24, 2023
@LinneyS LinneyS changed the base branch from develop to hotfix/leeway February 25, 2023 09:52
@LinneyS
Copy link
Member

LinneyS commented Feb 25, 2023

Thank you very much for your suggestion
We will review these changes and try to implement them in the next release.

@LinneyS LinneyS merged commit 89bfbe8 into ONLYOFFICE:hotfix/leeway Feb 25, 2023
@LinneyS LinneyS mentioned this pull request Feb 25, 2023
@LinneyS
Copy link
Member

LinneyS commented Feb 25, 2023

It was decided not to move the parameter to the admin settings page yet. Enough in the server configuration file.

@anon8675309
Copy link
Author

How can the leeway value be set without the configuration option being exposed in the admin settings page? Is the only option to do direct SQL UPDATE statements on the production server?

@LinneyS
Copy link
Member

LinneyS commented Mar 15, 2023

You can set it in config/config.php

'onlyoffice' => array (
    'jwt_leeway' => 10
)

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

Successfully merging this pull request may close these issues.

3 participants