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

Login doesn't work if the entered server URL redirects to another location #201

Open
vonshednob opened this issue Nov 27, 2021 · 11 comments
Labels
a:bug Something isn't working

Comments

@vonshednob
Copy link

It’s probably something very obvious that I’m doing wrong here, but I can’t quite find it.

So I set up my own server and and reach it fine through the webinterface, even from my android device.

However, when I try to use the app (version 2.2.0, installed from f-droid), I get the "There is no user with this username and password" error message. In the server logs, I can also see Error#01 for the access to /current/user.

Sorry if this is too obvious and could be found in the documentation. I didn’t find it.

@jmattheis
Copy link
Member

It could be related to #161, can you check if the issue still occurs with a password that only contains letters.

@vonshednob
Copy link
Author

The password was test, so it’s not immediately connected to #161, I think.

@jmattheis
Copy link
Member

Have you used some exotic username, that contained special characters?

@vonshednob
Copy link
Author

I was thinking the same, but it’s ANSI only, too. In line with some testing attempts you can probably guess the (hence deleted) user’s name: test.

@jmattheis
Copy link
Member

Hmpf, this should work. How have you started gotify, is there any reverse proxy in front of gotify?

@vonshednob
Copy link
Author

Alright, some more on the setup: gotify is running on a machine in the internal network and an nginx proxy is forwarding and de-https’ing the requests for gotify.

I was wondering whether the sub-path on the nginx proxy might be the problem. It’s some /obscure/.sub-path/thingy (as close to reality as can be).
However, I see the requests from the android client arriving at the server (tail’ing the log).

@vonshednob
Copy link
Author

So, looks like there was another step of redirection in between that got lost in translation.

The entry point is example.org/obscure/.sub-path/thingy, but it will 301 permanent to proxy.example.org/obscure/.sub-path/thingy. The latter is the nginx proxy as described above.

Now, when I use the example.org entry point in the app, it fails to log in (however, it correctly detects that there’s a gotify service running there). But if I use proxy.example.org as the entry point, it works!

That’s probably a bug?

@jmattheis
Copy link
Member

I'd say this is undefined behavior. It could probably be fixed, but I'd guess no one actually has a use-case for this, and can just use a URL that doesn't redirect.

@vonshednob
Copy link
Author

Fair enough. My irritation stems from the fact that it’s working to some extend (requests seem to go through, as I can see some requests arrive from the android client on the server) and that the website works.

However, since there is a work-around, I don’t see any urgency :)

Thanks a lot for the software!

@jmattheis jmattheis changed the title Unable to log in through app, but login through webinterface works fine Login doesn't work if the entered server URL redirects to another location Dec 6, 2021
@jmattheis jmattheis added the a:bug Something isn't working label Dec 6, 2021
@novaliswolf
Copy link

novaliswolf commented Jan 3, 2024

Hi, just wanted to mention that I've ran into this issue as well. This is what I have set up:

  1. Gotify running in docker
  2. Traefik acting as a revers proxy redirecting HTTP traffic to HTTPS for gotify and assigning a letsencrypt certificate (for internal domain)
  3. Exposed Gotify using a cloudflare tunnel which points to traefik.

This all works internally/externally on a web browser, but for some reason on the android app it gives me the same error message as @vonshednob.

Unfortunately even after a lot of testing I couldn't get it to work, so I've had to map and expose the port outside of traefik in the dockerd compose file specifically for Gotify and changed the clouldflare tunnel so that it goes to http://$dockerHostIp:$mappedPort directly and that works.

I don't know enough to say what the problem is but it does feel like something to do with the request going through a reverse proxy that's making the android app unhappy (as I said via mobile browser I can login using the original method)

Thanks and happy new year!

Edit: Forgot to mention - this works fine when using nginx proxy manager as the reverse proxy and cloudflare tunnel so it could be something specific to traefik

@jmattheis
Copy link
Member

jmattheis commented Jan 7, 2024

@novaliswolf Have you configured the https address in the android app? The android app should work fine with a reverse proxy as long as there are no redirects. Would you mind sharing your gotify url + a non admin account? (you can do so privately via the email on my profile).

And could you post your traefik config? Preferably in a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug Something isn't working
Development

No branches or pull requests

3 participants