I have a confluence of a few things that are all great individually but when I bring them together, they are causing problems.
I have an Angular SPA, updated to Angular 20, that uses a Keycloak server for OAuth2 authentication and, when deployed, runs in what is essentially a Docker container.
Angular SPAs don't always play well with Docker, which I resolved by using hash routing as outlined here. Everything was going well until I tried to log in. It turns out that hash routing really confuses my OAuth server. The /auth endpoint in the server tries to redirect here after login
http://localhost:4201/?state=c28xOTNSNC5HcHl0UkpWQXV6NnRwSm5MSjhjMWFrdDlrRWRrOUxmSm5BbmpZ&session_state=0ad042e8-2404-4f99-aa05-bcb4515287c8&iss=http%3A%2F%2Fkeycloak.psn.local%3A5005%2Fauth%2Frealms%2Fsocial-network-ecosystem&code=1a269f9e-09e7-410d-9385-b6c9a5405d44.0ad042e8-2404-4f99-aa05-bcb4515287c8.fe697efd-d696-444a-894a-6e6720dde121#/home
Which you will note is the host url, all the query params, and then the route info. Angular doesn't know what to do with that, so the UI doesn't track the tokens. Keycloak does not consider this a bug on their end. The GitHub issues for angular2-oauth-oidc, the login lib I've been using, suggests using the query response mode, but I'm getting the same issue as the person in the final comment, a failure on post /
My final plan was to move to SSR, which I'm told can fix routing in Docker without the hashes, but this lib angular2-oauth-oidc doesn't work well with it. They link to this guide in their documentation, but I didn't get any motion trying to implement it, possibly because it's from 2017.
So I have a couple possible solutions, any one of which should solve my problem. I need a way to do routing in Docker without hashes or SSR. I need to get SSR to work with my oauth lib. I need a way to get Keycloak to handle a hashed redirect URI in a way Angular can accept.
The last solution I have is to migrate to SSR and make my own login handling.
http://localhost:8080. But if you were not using Docker, you'd still need the web server on your dev machine, and you'd still need to fetch from something likehttp://localhost:8080./homecan be retrieved. Isn't the solution then to do the same inside Docker, maybe using a bind mount? In other words, I am not sure you've shown that Docker changes anything, and it looks like the answer below explains that Docker works for the author./homethe router is then able to find it. There's also a guide for this in the first link I put in the original question. So it's possible to route through that server in a way that is, at least to the end user, the same as routing inng serve. The problem here turned out to be that I had set up that fallback to index incorrectly, and I failed to identify that as the problem until I asked here.