mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 23:02:59 +03:00
🐛 Bug Report: Caddy cant fetch metadata for OAuth 2.0 authorization server #387
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @myhrmans on GitHub.
Reproduction steps
*Running on remote computer/server
Expected behavior
Caddy to be able to start
Actual Behavior
Caddy does not start. It cant connect
I get "failed to fetch metadata for OAuth 2.0 authorization server".
Opening http::3333/.well-known/openid-configuration shows a json array with the correct info.
@myhrmans commented on GitHub:
@stonith404 commented on GitHub:
Oh yeah that might be the problem. You have configured the reverse proxy for Pocket ID in the same Caddyfile as you have the
caddy-securityconfiguration, right?@stonith404 commented on GitHub:
Can you try to set
metadata_urlandbase_auth_urltoid.<url>.com?metadata_urlmust be accessible by Caddy andbase_auth_urlby the browser.@myhrmans commented on GitHub:
Will caddy start the reverse proxy of pocket-id before caddy-security is trying to access it?
@myhrmans commented on GitHub:
Same issue unfortunately
@stonith404 commented on GitHub:
Maybe this helps? https://docs.authcrunch.com/docs/authenticate/oauth/backend-oauth2-endpoint#oauth-20-endpoint-delayed-start
@myhrmans commented on GitHub:
Yes, thats correct!
Here are the curls:
curl http://localhost:3333returns nothing.
curl http://localhost:3333/.well-known/openid-configurationreturns
@jmadden91 commented on GitHub:
I had this same problem. I commented out my caddy-security block, but left the reverse proxy for pocket-id.mydomain.com
Then started caddy, then once caddy was running, I uncommented the security block and reloaded my caddyfile
@stonith404 commented on GitHub:
In that case it makes sense that you've set
metadata_urltolocalhost:3333what happens if you runcurl http://localhost:3333?@myhrmans commented on GitHub:
That does solve it, but seem like a inconvenience. Maybe we can find a more permanent solution for this?
@myhrmans commented on GitHub:
Yes! I just found this aswell after trying multiple approaches haha. Came here to say that looks like a solution!
@jmadden91 commented on GitHub:
I just tested
delay_start 1and it works fine@stonith404 commented on GitHub:
Great. Do you think
delay_start 1would be sufficient or to which value did you set it?