0

I am implementing an angular App and want to list all existing Realms on the keycloak Server. I configured the realm-management Client Roles of the User Logged in. Now I am able to List all Realms in a Rest-Client (https://keycloakserver/auth/admin/realms) using the login-token of this user, but when I do the same in my SPA I end up in a CORS-Error:

Access to XMLHttpRequest at 'https://keycloakserver/auth/admin/realms' from origin 'https://localhost:9001' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I know how I can configure CORS Headers for a specific Client, but in my case where do I find the client or is there another way?

csbrogi
  • 424
  • 3
  • 14
  • CORS issue usually indicates a problem with Web Origin client configuration (https://github.com/jangaraj/keycloak-cors-issue-debugging) – Jan Garaj Nov 17 '21 at 17:59
  • OK that put me in the wright direction (see my answer below) Thanks – csbrogi Nov 18 '21 at 08:49

1 Answers1

0

Ok I found the solution I had to add a + To the web-Origins.I thought it was enough to have the valid Redirect URL

csbrogi
  • 424
  • 3
  • 14