-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added support for Jottacloud cli token #7
Conversation
b46f398
to
5d0e5b0
Compare
Pushed some small tweaks after performing some more manual testing:
|
5d0e5b0
to
c4e5ac8
Compare
Pushed a bugfix reported by @jthall in the related issue: Jottacloud returns the personal login token with base64 encoding in "dialect": raw (as in no padding) and urlsafe (as in "-" used instead of "+", and "_" used instead of "/"). |
c4e5ac8
to
cf69fec
Compare
Use bootstrap styling, with size according to parent to make entire input visible, and mark input as required.
cf69fec
to
a3f50ea
Compare
Pushed another fix after feedback by @jthall: Using space delimited scope value "openid offline_access" according to standard, instead of plus delimited (which will be encoded into %2B) like rclone did ("offline_access+openid"). |
Great work @albertony |
I have now deployed a version that supports Jottacloud using the CLI token |
…i leading to HTTP 500 error This bug was introduced in duplicati#7
@kenkendk, I don't know if you considered these two things I was uncertain about, and if you can tell me a bit about them: What is the "fetchtoken", and is it relevant for the Jottacloud/CLIToken logic? And what is the significance of the user_id?
|
Regarding the fetch_token, I think I found the answer myself. Included a fix for this PR #10. Still wondering about the user_id.. |
Jottacloud used to support basic username/password authentication, but this was recently discontinued, while re-enabled for a limited time until June 1st 2022 after request from Duplicati users.
The new authentication in Jottacloud is based on OAuth and OpenID Connect. It does not use regular OAuth workflow, with redirect to login with callback etc. Instead, users have to manually log in to the official web gui and generate what they call a "Personal Login token" ("Generate a personal login token to log in to the Jottacloud Command-Line Tool"). This single-use token contains a username and password that can then be used as basic authentication to request a real OAuth token.
This PR adds Jottacloud as a provider. The login button leads to a new page showing a simple input box for the user to manually enter a "Personal Login Token". This is then used to request a OAuth token. Finally this is hooked into the same logic as the existing providers: Saving the token, generate authid, show the logged-in page.
Some question marks:
I have called it "CLI Token" in the code, currently. Not sure if that is the best name for it... OpenID has something called "ID Token", but I can't really get it to match what the Jottacloud token contains. Other services have something called "Personal Access Token". I ended up naming it "CLI Token" to avoid the confusion of using some name from a standard that is not really followed.
I was a bit unsure about the fetch token logic; is it correct to do the following in the CliTokenLoginHandler:
What is the significance of the user_id? It is not part of the token returned from Jottacloud, so it will be stored as N/A in oauth service. What is the effect of this? We do have the real username included in the login token, so we could use that if it is beneficial in any way..
Developer tested, but more real user/beta-testing would be nice (was asked for in forum, but not sure if anyone actually did the effort). First of all I have done manual testing of the web gui / rest api of the service itself. Then @jthall put a lot of effort into testing it with Duplicati, as discussed in the issue, successfully (after a couple of patches, mentioned in additional comments to this pr) running Duplicati against the oauth service running in a local python environment. Later, also described in comment on the issue, it was deployed to Google App Engine (at a custom/unofficial url) and then tested with Duplicati connecting to it, which also seem to work fine.
See: