How to fix cors error at my keycloak to make it work?

On keycloak client setup, add http://localhost:4200/* as valid redirect URI. In web origins a + is the best choice.

If you are using Java adapter, also set enable-cors tor true (see https://www.keycloak.org/docs/latest/securing_apps/index.html#_java_adapter_config)