|
12 | 12 | import shutil
|
13 | 13 | import tempfile
|
14 | 14 | import json
|
| 15 | +import uuid |
15 | 16 |
|
16 | 17 | from pathlib import Path
|
17 | 18 | from urllib import request
|
@@ -195,6 +196,7 @@ def download_jans_install_py(setup_branch):
|
195 | 196 | sys.path.insert(0, os.path.join(base.pylib_dir, 'gcs'))
|
196 | 197 |
|
197 | 198 | from setup_app.pylib.jproperties import Properties
|
| 199 | +from setup_app.pylib import jwt |
198 | 200 | from setup_app.pylib.ldif4.ldif import LDIFWriter
|
199 | 201 | from setup_app.utils.package_utils import packageUtils
|
200 | 202 | from setup_app.config import Config
|
@@ -460,9 +462,25 @@ def install_gluu_admin_ui(self):
|
460 | 462 | print("Copying files to", Config.templateRenderingDict['admin_ui_apache_root'])
|
461 | 463 | config_api_installer.copy_tree(os.path.join(self.source_dir, 'dist'), Config.templateRenderingDict['admin_ui_apache_root'])
|
462 | 464 |
|
| 465 | + |
| 466 | + ssa = installed_components.get('ssa') |
| 467 | + ssa_json = {} |
| 468 | + if ssa: |
| 469 | + ssa_json = jwt.decode( |
| 470 | + ssa, |
| 471 | + options={ |
| 472 | + 'verify_signature': False, |
| 473 | + 'verify_exp': True, |
| 474 | + 'verify_aud': False |
| 475 | + } |
| 476 | + ) |
| 477 | + |
463 | 478 | oidc_client = installed_components.get('oidc_client', {})
|
464 | 479 | Config.templateRenderingDict['oidc_client_id'] = oidc_client.get('client_id', '')
|
465 | 480 | Config.templateRenderingDict['oidc_client_secret'] = oidc_client.get('client_secret', '')
|
| 481 | + Config.templateRenderingDict['license_hardware_key'] = str(uuid.uuid4()) |
| 482 | + Config.templateRenderingDict['scan_license_auth_server_hostname'] = ssa_json.get('iss', '') |
| 483 | + Config.templateRenderingDict['scan_license_api_hostname'] = Config.templateRenderingDict['scan_license_auth_server_hostname'].replace('account', 'cloud') |
466 | 484 |
|
467 | 485 | print("Creating credentials encryption private and public key")
|
468 | 486 |
|
@@ -837,6 +855,8 @@ def get_components_from_setup_properties():
|
837 | 855 | def obtain_oidc_client_credidentials():
|
838 | 856 | with open(argsp.admin_ui_ssa) as f:
|
839 | 857 | ssa = f.read()
|
| 858 | + installed_components['ssa'] = ssa |
| 859 | + |
840 | 860 | data = {
|
841 | 861 | "software_statement": ssa,
|
842 | 862 | "response_types": ["token"],
|
|
0 commit comments