Solution for Hash based Routes
In OAuth 2.0 and OIDC flow, authentication and retrieval tokens are processed based on redirect URL. This redirect URL should work based on path routes. But the City’s frontend applications are working with hash based routes because of WordPress limitations. So we shouldn’t use path based but hash one. In order to solve this issue, we can try with two options.
BFF pattern enables us to use hash routes via proxy server. The clients request authentication and the proxy server communicates to the FR AIC for authentication and token exchanges. Once it is done, it will redirect to the client based on hash route passing the tokens.
Instead of using a separate callback URL, we can use the root path as a callback. It doesn’t require an additional server. FR AIC can redirect the user to the client root path and cotjs-auth library will take care of exchanging the code and stat for tokens.
Final Solution
We chose #2 to resolve the hash route issue.