-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat(mobile): Add support for Basic Authentication #6840
Conversation
Please look for other PRs before opening one :) (#6617) |
Sorry just read your comment on the other PR |
Maybe I should have mentioned the other PR in the first comment. Didn't expect someone to react that fast. 😉 By the way, I didn't touch |
I see that you manually add the basic auth Other than that it looks good to me. |
Yes, because I tested it. Would be great if you could also test with your setup. This might be the place where the credentials get added: https://github.com/dart-lang/sdk/blob/2a88162b841b5b93a36f698336404dc8f4e9b150/sdk/lib/_http/http_impl.dart#L2162 |
I just tested with my setup and indeed it does work! The source that I was looking at is https://github.com/dart-lang/http/tree/master/pkgs/http - which I thought was being used as the import looked like a package rather than part of the SDK. I've never used Dart before so probably got this wrong. Regardless, as long as it works, and it certainly appears to, I'm happy. |
Sorry for what might be a dumb question but is this supported in the lastest version of the app? |
Yes, it should be. |
EDIT: Had to get the server up to date (derp) and it works now. |
Use the
x-immich-user-token
header instead ofAuthentication: Bearer <token>
to allow for Basic Authentication credentials in the server URL (e.g.https://user:[email protected]
). Most of the codebase handles the latter automatically, however theAuthorization: Basic ...
header used to be overwritten.Only exception:
socket_io_client
doesn't seem to support getting credentials this way, so we have to add them via manually craftedAuthorization
header.Tested on Android against nginx reverse proxy. With these changes, the nginx log doesn't show any unauthenticated requests anymore, so I hope I found all places.
While I was at it, I changed all variable names to
accessToken
. Some were calledauthToken
,token
or evenjwtToken
.