Skip to content

[Feature]: Ability to pass custom headers via mobile apps#1305

Description

@pkosiec

Feature detail

Hello there 馃憢
Firstly, I'd like to thank you for such an awesome project. It's incredible how fast it improves with brand-new features! 馃殌

Context

I set up Immich on my NAS, and wanted to secure it with Cloudflare Zero Trust on a public hostname. That means, I want to have Immich accessible publicly, but behind another layer of authentication provided by Cloudflare. If user navigates to the public hostname, the user is redirected by Cloudflare to log in via SSO. Based on custom access rules defined in Cloudflare Dashboard, the user is able to access the app or not.

It works perfectly in the web browser, but it doesn't in a mobile app, as it cannot connect because of the redirection to the login form. However, Cloudflare allows generating Service tokens, which means that if a client provides two custom headers and will follow the redirection, it will authenticate the client and can access the original site (based on the access policies).

So, basically, this won't work:

curl -vL https://immich.example.com/api # fetches Cloudflare login site

But this will:

curl -H "CF-Access-Client-Id: ...." -H "CF-Access-Client-Secret: ..." -vL https://immich.example.com/api # returns the original 404 API response

Idea

An ability to set multiple custom headers as a part of the login screen to the mobile app. If I were able to set two custom headers from the login view, it would mean Cloudlfare Zero Trust and also other auth solutions can be used with the mobile app. Of course, the app would need to use them with each API request.

I imagine this could be implemented as a button/link (e.g. "Advanced") on the login view, which could open a modal with additional configuration options: additional headers and later something more (e.g. "Accept self-signed certificate"). Something like this:

IMG_E2C355A812A8-1

I'd be happy to contribute, however I don't know Dart and that could be a problem for me to develop some advanced views 馃 Any guidance is warmly welcome.

But first, let me know what do you think about this idea! Cheers!

Platform

Mobile App

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions