EGA-archive / beacon2-ri-api

Beacon v2 Reference Implementation (API)
Apache License 2.0
16 stars 38 forks source link

Beacon frontend: Remove hard-coded string for Keycloak realm #362

Closed AlesCUMSI closed 3 weeks ago

AlesCUMSI commented 3 weeks ago

Description:

In file AuthContext.js, the hardcoded string for the Keycloak realm Beacon should be replaced with an environment variable. Specifically, replace the string Beacon with ${process.env.REACT_APP_KEYCLOAK_CLIENT_REALM} to allow for better configurability.

Steps to Address:

  1. Update AuthContext.js:

    • Replace the hardcoded Keycloak realm string Beacon with ${process.env.REACT_APP_KEYCLOAK_CLIENT_REALM}.
  2. (Optional) Consider updating the Keycloak service to a newer version.

    • This update would also involve removing the "/auth/" endpoint (no longer required as it has been removed by default since Keycloak version 17) in url in files SignInFormNoLS.js and AuthContext.js.
costero-e commented 3 weeks ago

Hi @AlesCUMSI, thanks for opening this issue.

In the recent PR I have made, I have addressed this with step 1 suggested. File now will look for the .env REALM variable: configData.KEYCLOAK_URL + '/auth/realms/' + process.env.REACT_APP_KEYCLOAK_CLIENT_REALM + '/protocol/openid-connect/token', For step 2, I have it pending to update to the last version of Keycloak but first I have to test everything is working with the new version.

Thank you very much,

Oriol