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

Username or password incorrect on latest version of Shaarli #42

Closed
GitHubGeek opened this issue Feb 21, 2020 · 23 comments · Fixed by #43
Closed

Username or password incorrect on latest version of Shaarli #42

GitHubGeek opened this issue Feb 21, 2020 · 23 comments · Fixed by #43
Labels

Comments

@GitHubGeek
Copy link

Hi!

Thanks for making this awesome Android app - Love the simplicity!

Recently I've upgraded to the latest Shaarli docker master branch (docker pull shaarli/shaarli:master). Now when I re-add the account in Shaarlier, my username and password are not accepted after tapping "Try and Save".

How do I debug this issue? I've tried clearing app data but issue persist.

Thanks again

@bes1967
Copy link

bes1967 commented Feb 27, 2020

Hi!
This is a really great app. But the same issue here. I can login to shaarli from mobile or desktop browser, but not from the app. And this behavior has been going on since I've upgraded to the latest Shaarli docker master branch (shaarli/shaarli:master). Today I've updated docker image once more, new version has been pulled, but nothing has changed - no login from app. No matter what you are trying to do - to add new bookmark (through sharing), or just to push "Try it" button in account settings.
Thanks.

@ArthurHoaro
Copy link

Hi guys, I've started to work on the next Shaarli version which will use Slim framework controllers instead of legacy request router. Therefore, /?do=login now redirects to /login on the master branch. Since this app does not use the REST API, I think this might be why you encounter this issue.

@bes1967
Copy link

bes1967 commented Feb 28, 2020

ArthurHoaro, thanks. I was thought the problem is that the application is not using REST API. I've read somewere that the author plans to use API while developing version 2.0. Let's hope that it will be so. So far I decided to try Stakali

@dimtion
Copy link
Owner

dimtion commented Feb 28, 2020

Hi guys!

Thank you for bringing this up to my attention.

Please excuse the late response, I don't have that much time to give to Shaarlier, but you should at least have an update about the state of the project.

@ArthurHoaro is right about the cause of the issue, Shaarli have made some changes on how the urls are handled, and since the application is not using any API Shaalier needs an update to handle those new API urls. This was a design decision made way back when the Rest API did not exist.

Before that braking change, updating to the Shaarli RestAPI was a bit of work (namely rewrite the network manager), but there were no real incentive, apart from integrating more features, to make the work. Now that this is breaking the interface for some users I shall at least spend some time upgrading that part of the app.

However I cannot guarantee you any timeline, I work mostly on this project when I have the motivation, but I would be pleased for any PR helping in this direction.

In the mean time you could use Stakali, it looks like a great app, but unfortunately it is not a Free and Open Source Software.

@dimtion dimtion added the bug label Feb 28, 2020
@bes1967
Copy link

bes1967 commented Feb 28, 2020

@dimtion, it’s good to hear from you that you have plans to spend time implementing the client for the Shaarli REST API. Yes, Stakali, unfortunately, is not an open source project, and the author is not going to make it open source. In addition, the free version has some limitations. So I hope we'll see a new version of Shaarlier ... someday ;)

@GitHubGeek
Copy link
Author

Thanks a lot for the reply. I've downgraded* to the latest docker image and got Shaarlier working again.

Thanks again, Loïc & Arthur, for your FOSS projects Shaarlier & Shaarli. 🍻

(*) Be sure to export all bookmarks before downgrade as the data store isn't compatible.

@dimtion
Copy link
Owner

dimtion commented Mar 9, 2020

@ArthurHoaro I was looking a bit on how I could implement the the API in Shaarlier, and it seems that external plugins such as Shaarli2Twitter or Shaarli2Mastodon are not supported yet by the Rest API.

Since these features are quite popular in Shaarlier users, and before I open an issue, do you have any information if there is any plan for opening the API to toggle external plugins features?

@dimtion
Copy link
Owner

dimtion commented Mar 16, 2020

Hey guys,

I had a bit of time to work on this matter during this week, and drafted a new version of Shaarlier that uses Shaarli API.
Would you have a bit of time to test and give me feedback on this version? You can download it from the releases tab of Github:
https://github.com/dimtion/Shaarlier/releases/tag/v1.7.0a

Once installed, you'll need to go to your account settings and set a valid Rest API Key.

There are still some limitations, such as tweets and toots that don't work. Since I'm not sure how to handle those plugins without any change to Shaarli API.

Before doing a full rollout, I'd like to improve the account configuration UX, since right now it might be a bit confusing that the combo username / password is mutually exclusive with the use of the API key (with the API key having the priority).

@nikonakoneko
Copy link

The share dialog disappear instantly and go back to setting like in this screen cast

@dimtion
Copy link
Owner

dimtion commented Mar 16, 2020

Hi @soratobukuroneko,

Thank you for the screencast, if I'm not mistaking you have no Shaarli account configured. If not done I would suggest to click on "Add account" on the main screen.

Let me know if you already did that, in which case it looks like a weird bug.

@nikonakoneko
Copy link

I did that but then it returns to the main screen like if I had no account

@dimtion
Copy link
Owner

dimtion commented Mar 16, 2020 via email

@GitHubGeek
Copy link
Author

Thanks so much for the update 🥇 ! It's now on F-Droid. :

Upgraded and did a quick test against Shaarli 0.11.1 - Saving links is working.

Will upgrade shaarli server to master and test again when I find some time.

@dimtion
Copy link
Owner

dimtion commented Mar 20, 2020

Thank you @GitHubGeek! I'll try to finalize this issue before posting it on the AppStore.

@soratobukuroneko I was not able to reproduce your issue.

Some questions, to help me find the issue

  • Can you try to remove and reinstall the application?
  • Could you provide me with more information about your setup? For example: Android version, phone type, battery saving setting?
  • On the account setting did you provide just the API token or a username and password?
  • When you save the account, does it appears in the list of accounts?

I'm sorry for the inconvenience!

@nikonakoneko
Copy link

nikonakoneko commented Mar 20, 2020

  • I reinstalled the app (from F-Droid)
  • Samsung SM-A520F (A5 2017) with LineageOS 16.0 20200316 microG (no Gapps). I tried disabling battery saving.
  • I tried everything: user and password, user and token, user and password and token
  • I have no account list anywhere

I can give you access to my shaarli instance if you want

@frdrcv
Copy link

frdrcv commented Apr 6, 2020

Hi everyone! I'm a new shaarli and shaarlier user and I've the same problem as @soratobukuroneko on my LG-H873 running Android 9 H87330b. I'm running my own instance of shaarli. I've tried the same steps as @soratobukuroneko without success.

@dimtion
Copy link
Owner

dimtion commented Apr 6, 2020

Hi @frdrcv ,

I've discussed with @soratobukuroneko in private to find out the source of the issue and it was due to his webhosting provider putting a Javascript challenge in every webpage, including the REST API endpoints.

You might want to check that the your internet provider doesn't do the same.

Also, are you on Shaarli 1.7.2? On this version I've added a clearer error message that might help you find out the origin of the issue. However if the application still crashes on your device this might be another bug of the application.

@frdrcv
Copy link

frdrcv commented Apr 7, 2020

Salut @dimtion,
Since yesterday I made some google searches and stumbled upon this blog post: https://ideatrash.net/2019/01/recommended-shaarli-stakali-and-your-cloud-bookmarks.html
Adding VirtualHost config file didn't solve the problem, though now I do have an error message when I try to configure shaarlier. It says I'm not using a valid shaarli URL. I just sent you the bug report by email (I don't want to make my shaarli URL public).
Thanks for your work and help.

@frdrcv
Copy link

frdrcv commented Apr 7, 2020

Oh, and concerning your last reply, if that's ok with you, I'll wait until you have the time to take a look at the bug report I sent you to contact my internet provider.

@dimtion dimtion reopened this Apr 7, 2020
@dimtion
Copy link
Owner

dimtion commented Apr 7, 2020

hi @frdrcv ,

Thank you for taking the time to figure this out together.
I'm sorry to inform you that I did not receive any bug report email (even in my junk folder). Are you sure the email was correctly sent?
If the email still does not work for some reason, could you post here the generated report (body of the email) with any information you find personnal stripped away?

In the mean time, could you provide some information about your setup:

  • Android version
  • Is battery saving enabled (that is sometimes a know bug)?
  • Which authentication method are you using, password or token?

@frdrcv
Copy link

frdrcv commented Apr 7, 2020

Strange, I just sent it again, maybe I actually forgot to send it yesterday while I was writing my last message here.

In all cases, here's the report :

-----BEGIN REPORT-----
Report type: DEBUG
Android version: 9
App version: 1.7.2
Activity: com.dimtion.shaarlier.activities.AddAccountActivity@a9fd9ae2020-04-07T15:37Z

TOKEN ERROR

java.lang.Exception: TOKEN ERROR

-----EXTRA-----
Url Shaarli: http://****.dns.com/shaarli/
-----END REPORT-----

  • I'm using Android 9
  • I tried with and without battery saving enabled with similar results
  • I'm using the token authentification method

Thanks for your time!

@eisengrau
Copy link

Hello,

Same issue as above.

-----BEGIN REPORT-----
Report type: DEBUG
Android version: 10
App version: 1.7.2
Activity: com.dimtion.shaarlier.activities.AddAccountActivity@c58b32c2020-06-15T03:05Z

TOKEN ERROR

java.lang.Exception: TOKEN ERROR

-----EXTRA-----
Url Shaarli: https://..com/shaarli/
-----END REPORT-----

Looks like it is something to do if shaarli is served under a subdir on apache (domain/shaarli).

Else, using LineageOS 17.1 official/ Android 10, Galaxy S9, installed Shaarlier from F-droid.

@dimtion
Copy link
Owner

dimtion commented Jul 4, 2020

Hey guys, sorry for the late response,

I'm trying to reproduce the issue on my side, however I cannot find the correct setup that trigger that error. @frdrcv @eisengrau @soratobukuroneko Could you help me with info about your Shaarli instance, namely:

  • What version of Shaarli have you installed?
  • What was your installation process for your Shaarli instance?
  • Are you sure the API is enabled on your instance (tools -> configure -> Enable API Rest) and that you are using the correct Secret key?

If from a terminal you do the following and have a similar result (HTTP 404), it means that your Shaarli version either is not compatible with the token authentication, or the API is disabled (if you don't have curl, you can do the same in your web browser:

curl https://shaarli-dev.dimtion.fr/api/v1/info

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.38 Server at shaarli-dev.dimtion.fr Port 443</address>
</body></html>

For example, here is the curl result for a working Shaarli instance:

curl https://shaarli.dimtion.fr/api/v1/info
{
    "message": "Not authorized: Invalid JWT header",
}

Thank you again for your help

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

Successfully merging a pull request may close this issue.

7 participants