-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[Bug]: add-app-password generated token are bad (and shouldn't ask for a password) #37487
Comments
I noticed that the "bad" app password token is working if used it in Thunderbird to add an addressbook. So maybe, the problem can come from the discovery part of the plugin. I created an issue in the plugin repo (mstilkerich/rcmcarddav#432). Hopefully, someone will see the problem. And for the password asked when generated an app password from the Cli, I really don't understand why it's required, but at least I know I can create one without Nextcloud asking for a password with the "--password-from-env" parameter. |
I was able to finally understand what was the problem. The two others are understood and fixed, but because of the 5 min lifetime problem, my system only works for 5 min then not more synchronisation possible (the same if I use a Cli generated token in Thunderbird ) I thought I did tests on a Nc24.0.3 (but without user_oidc app) and the token stayed good indefinitively, but now I updated my test NC to v25 (the one with user_oidc app), the token is again valid only 5 min. I really need them to stay good indefinitively. I tried, in the file
Can you tell me how to remove that 5 min validity for CLI generated token? Thank you. |
I would like also to advocate for a better cli command app-password-token. In a SSO setup, when a part of the equation doesn't recognise (yet) an authentication via the bearer token, we can resort to use an app password token, waiting for the feature to be coded. The app password token is very important to have temporary solutions, and the one generated from the CLI should have the same right as the one generated from the Web Ui. Also, lots fo good features can be added to that CLI command. Thanks |
I noticed a log line I didn't see before in nextcloud log.
From my understanding, there is a mix between the login used in the new authentication process (the login version) and the one already redistered in session (the mail version). I tested by disabling the user_oidc plugin and the token stayed good after the 5 mins. Debug that seemed too much for me, so I decided to come back to use the login and not the mail for the authentication process between roundcube and Nextcloud. I found a way to get my case sensitive login from the access token and use it in the carddav plugin context (mstilkerich/rcmcarddav#433). It's now working with logins that contains uppercase letters and the token doesn't have anymore the 5 min lifetime. |
Bug description
I adapted a Roundcube plugin (https://github.com/mstilkerich/rcmcarddav) to be able to auto synchronize users cloud addressbooks into their roundcube.
With the Nextcloud plugin https://github.com/pulsejet/nextcloud-oidc-login we were initially using, we could connect to Nextcloud from Roundcube thanks to the bearer token, but we had to switch to the other Nextcloud OIDC plugin https://github.com/nextcloud/user_oidc, and with that one, using the bearer token isn't working anymore (nextcloud/user_oidc#603).
So I decided to modify the carddav plugin to be able to use an app password to make the connection.
If I use a token I generated myself from my cloud account, everything is working perfectly, synchronisations, modifications, .. are good. new addressbooks are auto added into Roundcube.
If I use a token generated bu the CLI command add-app-password, giving a fake or the right user password, it doesn't work.
Why are you asking the user password to generate an app password via the CLI, that makes no sense to me (#26563 already explained that problem).
Second, why a token generated via the CLI doesn't work to synchronize address books?
Steps to reproduce
Expected behavior
Generating an app password from the Cli should have the same rights as generating an app password from the Web Ui.
Installation method
Other Community project
Nextcloud Server version
24
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
When using an app token generated by the CLI, I have this error: "No public access to this resource., No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigure"
Additional info
Installation method -> Debian package.
The text was updated successfully, but these errors were encountered: