question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CORS issue with the new version of Keycloak-angular

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search for issues before submitting
- [ ] feature request

Versions.

keycloak-angular: 7.3.1 Angular: 9.1.7 Keycloak 9.0.0.

Repro steps.

  1. New ream created
  2. New client created
  3. Client settings (image). Access type: Confidential and Authorization enabled as we want to use these features. image
  4. When the application runs, we are getting a CORS error.

Additional info: We did follow all the steps for library implementation. (Including view-profile within the scope)

The log given by the failure.

Console log output: image image

Desired functionality.

Previously, we used keycloak-angular 6.1.0 and we haven’t had this issue before. When we switched to the new version, the issue started appearing. Do you have any info on what could be causing the problem and what would be the best course of action to fix it?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14

github_iconTop GitHub Comments

2reactions
marquez2012commented, Aug 13, 2020

Thanks @DamjanJ . I’ve this issue and to solve i downgrade the version is order to use it. IMHO, it’s a shame to not provide this. An excelent project with with failure… 😕

0reactions
GretUpcommented, Jul 23, 2022

Is there an update on this issue? I am getting for the confidential client where we also need the authorization part: Access to XMLHttpRequest at ‘https://keycloakx.example.com/realms/xxxx/protocol/openid-connect/token’ from origin ‘http://localhost:4200/’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. We are using: “@angular/core”: “^12.2.0” “keycloak-angular”: “^8.4.0”, “keycloak-js”: “^15.1.1”

BTW: The solution from @MVVN did not help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keycloak angular No 'Access-Control-Allow-Origin' header is ...
TLDR; If you call keycloak endpoints before the init call is finished, the response will lack CORS headers and you'll get a CORS...
Read more >
CORS blocked #91 - mauriciovigolo/keycloak-angular - GitHub
I have setup keycloak on another host as my angular application. When I access the angular application I get redirected to the login...
Read more >
Keycloak CORS issue with Angular App - Getting advice
I currently have keycloak setup with a simple realm, the client is set to be confidential, webOrigins: https://localhost:4200, Browser Flow: ...
Read more >
How to Use Keycloak with a CORS-enabled API-gateway
This article describes how you can use Keycloak behind an API-gateway that considers CORS requests, which by default does not work.
Read more >
CORS REST request blocked by browser - keycloak-user
Hi to all,in my use case i have a typical web application made up on a frontend layer written completely with Angular js...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found