How to run Angular front end locally

I am trying to run Angular on my PC under http://localhost:4200

I have changed in Environments "clientUrl" to 'https://<ServerWithAPI>/ApiServer'

I also have created in designer settings.

Settings in designer:

  • Base Data\Security Settiongs\OAuth 2/0/OpenID Connect configuration with redirect URI "http://localhost:4200"
  • Base Data\Security Settiongs\Web server configuration to use OAuth2/OIDC for login

When I run project I am redirected to IDP for authentication which I pass succesfully.

Next I am redirected to localhost with the "code=...." - I get the code because I use Authentication Code Flow.

Now I expected that Api Server get's the code and use it with shared secret to exchange it with /token endpoint and get ID Token.

From some reasons it's not doing it, but instead it starts everything again. I mean: redirect me to /authorize for authentication, I get code again and provide to API Server but I am again redirected to /authorize. So, I am in the loop.

However, when I change redirect URI to "https://<ServerWithAPI>/ApiServer/html/qer-app-portal" and start in browser in localhost:4200 I have this flow:

  • I am redirected to IDP for authorization
  • I successfully authenticate
  • I am redirected back to "https://<ServerWithAPI>/ApiServer/html/qer-app-portal"
  • I see in network trace the session cookie "imx-session-portal" is added with call to "https://<>/ApiServer/imx/login/portal" (it contains in request payload code="eyJra....." and module="OAuthRoleBased" values)
  • I am authentication in "https://<ServerWithAPI>/ApiServer/html/qer-app-portal"
  • I change URL in browser to "http://localhost:4200" and I am authenticated and I can test modifications on localhost

I would like to understand what to configure to not need to every time switch to standard portal for authentication and custom portal to see modifications