Setting up authelia openid connect

Hello, I'm trying to set up authelia with immich. Everything is working fine except for the issuerURL. I'm following the documentation: https://immich.app/docs/administration/oauth, however whenever I navigate to http://192.168.1.121:8585/application/o/immich It displays this message
Error: Not found: /application/o/immich
at resolve (file:///app/immich/web/build/server/index.js:3839:18)
at resolve (file:///app/immich/web/build/server/index.js:3714:34)
at Object.handle (file:///app/immich/web/build/server/chunks/hooks.server-d5d6b947.js:21:21)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async respond (file:///app/immich/web/build/server/index.js:3712:22)
at async Array.ssr (file:///app/immich/web/build/handler.js:1190:3)
Error: Not found: /application/o/immich
at resolve (file:///app/immich/web/build/server/index.js:3839:18)
at resolve (file:///app/immich/web/build/server/index.js:3714:34)
at Object.handle (file:///app/immich/web/build/server/chunks/hooks.server-d5d6b947.js:21:21)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async respond (file:///app/immich/web/build/server/index.js:3712:22)
at async Array.ssr (file:///app/immich/web/build/handler.js:1190:3)
I've set that as my issuer url and set the rest up like this: https://i.imgur.com/Za4mWL5.png I'm making use of Authelia, where I've set it up in the following way:
- id: immich
description: Immich
secret: '$plaintext$SAME_SECRET_AS_IMMICH'
public: false
authorization_policy: two_factor
redirect_uris:
- app.immich:/
- https://image.mydomain.com/auth/login
- https://image.mydomain.com/user-settings
scopes:
- openid
- profile
- email
- groups
userinfo_signing_algorithm: none
- id: immich
description: Immich
secret: '$plaintext$SAME_SECRET_AS_IMMICH'
public: false
authorization_policy: two_factor
redirect_uris:
- app.immich:/
- https://image.mydomain.com/auth/login
- https://image.mydomain.com/user-settings
scopes:
- openid
- profile
- email
- groups
userinfo_signing_algorithm: none
What am I doing wrong here?
Imgur
45 Replies
MicheI
MicheI3y ago
192.168.1.121:8585 is your endpoint for Immich, right? Shouldn't the issuer URL be Authelia?
Quafley
QuafleyOP3y ago
would that be the one within the docker network or the public authentication website? yeah you got a point, completely misunderstood it
jrasm91
jrasm913y ago
It needs to be publicly accessible from the client (browser, phone) and accessible from the immich server container.
Quafley
QuafleyOP3y ago
okay that would mean auth.mydomain.com
jrasm91
jrasm913y ago
Yes
Quafley
QuafleyOP3y ago
alright going to try it out cool it works oh that is neat, since my authelia email and immich are the same I log in as the admin Quick question before I go on, would 'auto register' be good to have turned on? As long as I've configured it correctly, it should mean that everyone with an authelia account can log in right? ah wait, that would mean that everyone will be given the prompt, however only the people I allow will be able to "register" I don't know how to do that tho lol hm I think authelia doesn't allow this
jrasm91
jrasm913y ago
So a few things In the auth provider, meaning authelia there's probably the concepts of users, groups, and applications. You can configure there in the auth service what users can access what applications. Unrelated to any of that are the settings in immich. Auto register means when an authelia user accesses immich for the first time and an account doesn't already exist with the email address from authelia, it'll create a new non-admin user automatically. This is unrelated to authelia sign up and registration, which has to happen independently, before logging into immich. I use Google oauth and so i have auto register turned off. I don't want anybody with a Gmail address to be able to create an account on my instance. For a private hosted oauth service I would probably turn it on, as you're probably already controlling/restricting who can create an account in Authelia. With it on it would mean if someone has an account in Authelia they can login into immich without needing to pre register there. In both situations I'd probably turn off password login.
Quafley
QuafleyOP3y ago
Yeah so it's a bit odd because I'm getting the following message when users try to login with their authelia account (works for me somehow) "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. The 'redirect_uri' parameter does not match any of the OAuth 2.0 Client's pre-registered redirect urls."
jrasm91
jrasm913y ago
redirect_uri mismatching In Authelia you added a few urls that ended with /auth/login, etc. The domain part must also match the different places, urls you use to login. Those are all added? When you initiate the process what is the url you start at, and is that added in Authelia as a redirect uri?
Quafley
QuafleyOP3y ago
Well I'm redirected to auth.mydomain.com/consent
jrasm91
jrasm913y ago
Right, but what url are you coming from
jrasm91
jrasm913y ago
Is this url in Authelia as a redirect uri? https://image.mydomain.nl/auth/login
Quafley
QuafleyOP3y ago
redirect_uris:
- https://image.mydomain.nl/auth/login
- https://image.mydomain.nl/user-settings
- app.immich:/
redirect_uris:
- https://image.mydomain.nl/auth/login
- https://image.mydomain.nl/user-settings
- app.immich:/
weird thing is that it works for my own account
jrasm91
jrasm913y ago
You can currently login with another account? Are you logging in as another user, or somebody else is and telling you they got that error?
Quafley
QuafleyOP3y ago
I can login with the admin account, and the redirect works without issue it seems. and I get this :https://i.imgur.com/nobjxio.png and I get all https:// But when my friends visits it is as follows according to the browser history: http://image.mydomain.nl/auth/login http://image.mydomain.nl/auth/login?autolaunch=0 https://auth.mydomain.nl/oidc
Imgur
Quafley
QuafleyOP3y ago
so it's a bit odd as to why he even gets http websites in the first place
jrasm91
jrasm913y ago
Just have him login with the https variation of the link And you can probably configure your web server to automatically redirect http traffic to https
Quafley
QuafleyOP3y ago
but it shouldn't even be http in the first place never set it up that way
jrasm91
jrasm913y ago
Does that url work for you? http implies port 80 https implies port 443. You can check if port 80 is open and/or if it redirects to immich
Quafley
QuafleyOP3y ago
when I go http it instantly corrects it as https
jrasm91
jrasm913y ago
What about not on your local network?
Quafley
QuafleyOP3y ago
it instantly redirects me to auth.mydomain.nl consent page as https I've opened up my immich container using a reverse proxy which I've configured to be https got my certs from cf
jrasm91
jrasm913y ago
Weird Anyway http vs https are considered different urls. Can your friend access the https url variation?
Quafley
QuafleyOP3y ago
works without issue But I wonder why he is able to get to http that shouldn't be possible right?
jrasm91
jrasm913y ago
It is an interesting question. Can you very port 80 is blocked by your router?
Quafley
QuafleyOP3y ago
I'm just worried about possible misconfiguration Well I only have port 443 portforwarded so yes for the reverse proxy
jrasm91
jrasm913y ago
Yeah, might be good to just double check. Does your dns point to your public ip or does it go through cloudflare?
Quafley
QuafleyOP3y ago
Just did it's not there luckily haha this is within cloudflare zero I run everything through cloudflare tunnels with proxy enabled for now I might need to turn it off because of tos
jrasm91
jrasm913y ago
This says any requests to that domain get send to https://swag:443
Quafley
QuafleyOP3y ago
Yes, that is because the cloudflare tunnels is set up to work through swag otherwise it would ignore authentication and go straight to the app this way I get to have authelia authentication perhaps it's something within my swag config for immich
jrasm91
jrasm913y ago
That's fine. You may be able to connect to cloudflare over port 80 still It'll still hit the rule and send the connection to swag:443.
Quafley
QuafleyOP3y ago
I shouldn't be able to really, since I've set up a catch-all rule for http_status:404
jrasm91
jrasm913y ago
That's if the domain doesn't match though
Quafley
QuafleyOP3y ago
owh
jrasm91
jrasm913y ago
The rule is domain => target If the web server listens on port 1000 you can connect on 1000 and it'll still send it to 443 internally. If the request sends the origin: hostname header, it'll still match the rule.
Quafley
QuafleyOP3y ago
could this perhaps be the problem? https://i.imgur.com/mtaS8cW.png
Imgur
Quafley
QuafleyOP3y ago
It shouldn't be, since connection within the docker network is http
jrasm91
jrasm913y ago
You have a connection routing through a few different web servers and between each one they can use http or https. Remote client => cloud flare web server => docker swag server => immich proxy server => immich web/immich server Your friend connecting over http means that the first connection has port 80 open. So Remove client => cloud flare web server Anyway, if you can't reproduce it on a mobile network (not on your wifi/lan) then I'd probably not worry too much.
Quafley
QuafleyOP3y ago
yeah it doesn't sit well. I've asked him to navigate to http://image.mydomain.nl and he just gets on well not logged in But still, he gets on to my site
Quafley
QuafleyOP3y ago
No description
Quafley
QuafleyOP3y ago
That seems to have done it
jrasm91
jrasm913y ago
What that a cloud flare thing?

Did you find this page helpful?