After declaring the environment variables on docker run and exposing on port 2015 all roots are being redirected to a /login path, showing the Github template.
Following the authentication flow, the following is echoed by the server logs:
I wonder whether the redirect is actually coming from Caddy or if it’s Github issuing that redirect.
You could try passing the intended redirect location to Github?
e.g. github client_id={$github_client_id},client_secret={$github_client_secret},redirect_uri=https://example.com/ (replacing example.com as appropriate)
I have added the optional redirect with no success. The request continues to be authenticated but I am returned to the \login route as opposed to the \ <== success url route.
I am re-reading the loginserv project to see if I have missed something, any other suggestions would be amazing - thank you!
This correctly goes through the Github OAuth if you hit the /login route and passes you onto the success URL. However, if you hit the success URL you bypass the OAuth …
Am I missing a step where the JWT token is checked when hitting any route other than /login?
Just to check, your browser is sending the token, right? It’s in your request headers when you revisit the main URL?
Might have to start simplifying things and sort out where things break down. Can you try with a htpasswd file or simple auth and see if it still doesn’t authenticate properly?
Essentially, in local development you needed to switch cookie_secure false for login. I couldn’t find this in the documentation and the silent failures of JWT along with the incorrect “successful authentication” messages from my server made this pretty opaque!
I hope this thread helps anyone else who finds themselves in the same position