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

Advanced authentication options #624

Open
FunDeckHermit opened this issue Dec 19, 2021 · 8 comments
Open

Advanced authentication options #624

FunDeckHermit opened this issue Dec 19, 2021 · 8 comments
Labels
discussion Raises questions that are up for discussion feature A new idea or feature

Comments

@FunDeckHermit
Copy link

FunDeckHermit commented Dec 19, 2021

Is your feature request related to a problem? Please describe.
My photoview instance is running behind Authentik. This causes two login screens for users to be traversed.

Describe the solution you'd like
From simple to advanced there are a couple of options:

  1. Disable authentication (Photo browsing without logging in #478)
  2. Disable authentication with IP/CIDR whitelist
  3. Basic auth (prompt or http://username:password@example.com/)
  4. Header based authentication (like Navidrome)
  5. oidc/oauth2 integration
  6. LDAP integration (LDAP Support #272)

Describe alternatives you've considered
Editing the HTML and hardcode a password at the login screen

Additional context
All options up to option 4 are quite easy to implement without a lot of hassle.
I personally prefer header based authentication as you will be able to pass through additional information in headers. It's also easy to use as each reverse-proxy is able to inject some headers. It's also safe as the Header is a variable and can be different for each instance.

@viktorstrate viktorstrate added the feature A new idea or feature label Feb 7, 2022
@viktorstrate
Copy link
Member

The immediate problem I can think of with something like header based authentication is that loading images relies on cookies as there aren't any ways to send custom headers for <img /> tags.

So the server would have to recognize that an authorized request is made based on the headers and then set the cookie for the response. I guess this might be ok, but I don't know if there might be any pitfalls doing it that way.
I guess the headers could easily become out of sync with the cookie?

@viktorstrate viktorstrate added the discussion Raises questions that are up for discussion label Feb 7, 2022
@rpatel3001
Copy link

Just want to +1 header auth as all my services are behind traefik with traefik-forward auth, which sets X-Forwarded-User after a google login flow. I currently am the only user so disabling auth altogether would also work for now. I'm not familiar with this codebase and how it uses cookies, but grafana is another potential reference for implementing this.

@viktorstrate
Copy link
Member

@rpatel3001 Grafana might be worth a look.

Maybe having an environment variable to completely disable any form of authentication and just have a single admin user that is always logged in, might be a nice start.
I think that would be simple and useful for many users who either run the instance locally-only or behind other means of authentication.
That way cookie authentication could also simply be turned off completely.

@Sieboldianus
Copy link

This is only somewhat related: Is there any way to increase the lifetime of the auth cookie?

I have Photoview set up internally for several family members, some of them are too old to deal with username/passwords. Currently, I've set up Shared Photoview Links on their Android homescreens, which don't require logins. If I could extend the lifetime of auth cookies (lets say up to 1 year), they could use the native PWA with their own useraccounts.

@alexanderadam
Copy link

alexanderadam commented Jun 4, 2022

Implementing OpenID Connect would also solve issue 565 for some users since IDP like Authelia, Keycloak or Authentik support OTP out of the box.

There are also battle tested packages available for Go (i.e. go-oidc, oidc and others).

@Akshay-Hegde
Copy link

@FunDeckHermit Did you find any way to disable authentication ?

@viktorstrate viktorstrate mentioned this issue Mar 16, 2023
@Akshay-Hegde
Copy link

@FunDeckHermit : I managed to show using different way #818 (comment)

@kkovaletp
Copy link
Contributor

@jordy2254, I think that this discussion might be interesting to you in the scope of user management epic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Raises questions that are up for discussion feature A new idea or feature
Projects
None yet
Development

No branches or pull requests

7 participants