Keycloak-angular: Question: keycloak.json for production environment

Created on 16 Jan 2019  路  2Comments  路  Source: mauriciovigolo/keycloak-angular

Bug Report or Feature Request (mark with an x)

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

Versions.


Angular 7.0.4
Keycloak-angular 6.0.0
Keycloak 4.8.2

Question:

The imported keycloak.json contains the URL of the development Keycloak server. For production how can you replace the URL? Reimport the keycloak.json from the production Keycloak?

Desired functionality.

At least a procedure description in README how to handle the keycloak.json for production.
Thanks!

Most helpful comment

see /examples/keycloak-heroes/src/app/utils/app-init.ts

All 2 comments

see /examples/keycloak-heroes/src/app/utils/app-init.ts

Hi @ostmond, first of all, thanks for opening this issue.

That's right, in my opinion, the best way to setup this keycloak info in an angular application is by using the environment files. However your issue is indeed meaningful regarding:

  1. Documentation improvement.
  2. For those wanting to work with keycloak.json file, how to properly deal with environments on deploy.

The first topic, documentation, will be solved in the next milestone - v.6.1.0. There are lots of lacks in documentation and this is truly a must for the project and it's future.

For the second one, there are a couple of ways to solve:

  • Create a script during the npm build process that creates keycloak.json dynamically inside the desired folder, as configured in angular.json -> assets:[..]
  • Create a step in your CI/CD process, for example in Jenkins or Travis.

IMO the best approach is by using the angular environment files and configs, since this file doesn't hold sensitive data.

Thanks!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nfriend picture nfriend  路  4Comments

samherrmann picture samherrmann  路  3Comments

its-vincesanity picture its-vincesanity  路  4Comments

ValentinBossi picture ValentinBossi  路  4Comments

unib1t picture unib1t  路  4Comments