Why do i get CORS error on a Keycloak redirect using a Quarkus backend and an Angular client?

Discussão em 'Angular' iniciado por Izanagi7, Dezembro 2, 2024.

  1. Izanagi7

    Izanagi7 Guest

    I'm developing a simple Angular-Quarkus-Keycloak Authentication application. The application, once logged in with Keycloak, retrieves the access token, and then sends the access token to my Quarkus backend for validation. The access token retrieval works as espected, using an Authorization Code Flow PKCE. When i execute the get request with the Authentication: Bearer , i get this error:

    Cors Error

    I enabled CORS on my Quarkus backend as it follows:

    application.properties file on Quarkus backend

    The Quarkus Extensions used by my backend are:

    Quarkus Backend Extensions

    The HTTP request fired from Angular Client is:

    Angular HTTP GET request

    I'm using keycloak.js and keycloak.angular packages.

    The resource i'm trying to access on the backend:

    Quarkus Resource

    The configuration on my Keycloak server:

    Keycloak Server Configuration

    I have no idea how to fix this.

    I've tried changing Keycloak configurations lots of times, adding specific web origins or generic (*), but it's no use.

    I've tried changing Quarkus configuration too, adding specific origins, but no use.

    Continue reading...

Compartilhe esta Página