From c28cacd1568c7f63f3b69927c4ed3ac0921ab484 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 11:26:50 +0530 Subject: [PATCH 01/20] feat: Support for Management API CLI --- .github/workflows/aws-publish.yml | 66 ++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 46948cc..eaac178 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -43,4 +43,68 @@ jobs: # Step 6: Upload to S3 - name: Upload to S3 run: | - aws s3 cp ./dist s3://universal-login-sample-app/ --recursive \ No newline at end of file + aws s3 cp ./dist s3://universal-login-sample-app/ --recursive + + - name: Manually create test folders under dist/ (for testing only) + run: | + mkdir -p dist/loginid + mkdir -p dist/login + # Copy the existing built files into these folders + cp dist/index.js dist/loginid/index.js + cp dist/index.css dist/loginid/index.css + cp dist/index.html dist/loginid/index.html + cp dist/*.png dist/loginid/ + cp dist/index.js dist/login/index.js + cp dist/index.css dist/login/index.css + cp dist/index.html dist/login/index.html + cp dist/*.png dist/login/ + echo "Created test folders with copied build files:" + ls -R dist/ + + - name: Generate settings JSON files dynamically + run: | + for screen_folder in dist/*; do + if [ -d "$screen_folder" ]; then + screen_name=$(basename "$screen_folder") + cat < "$screen_name-settings.json" + { + "rendering_mode": "advanced", + "context_configuration": [ + "screen.texts", + "screen.hasCaptcha", + "screen.captchaImage" + ], + "head_tags": [ + { + "tag": "script", + "attributes": { + "src": "\$CDN_URL/$screen_name/index.js", + "integrity": "sha384-\$jsHash", + "crossorigin": "anonymous" + } + }, + { + "tag": "link", + "attributes": { + "href": "\$CDN_URL/$screen_name/index.css", + "rel": "stylesheet", + "integrity": "sha384-\$cssHash", + "crossorigin": "anonymous" + } + } + ] + } + EOF + echo "Generated settings file: $screen_name-settings.json" + fi + done + + - name: Update Management API using Auth0 CLI + run: | + for screen_folder in dist/*; do + if [ -d "$screen_folder" ]; then + screen_name=$(basename "$screen_folder") + auth0 ui customize --rendering-mode advanced --prompt login-id --screen $screen_name --settings-file "./$screen_name-settings.json" + echo "Updated Auth0 UI for screen: $screen_name" + fi + done \ No newline at end of file From 861be3840cb527328b8ce39033fec4ee55ccd557 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 12:32:10 +0530 Subject: [PATCH 02/20] Testing the changes --- .github/workflows/aws-publish.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index eaac178..cbf4f12 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -3,6 +3,8 @@ on: push: branches: - master # Trigger on PRs targeting 'master' branch + types: + - opened workflow_dispatch: jobs: @@ -33,17 +35,17 @@ jobs: run: npm run build # Step 5: Configure AWS credentials via OIDC - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_S3_ARN }} - aws-region: ap-southeast-2 - mask-aws-account-id: true + # - name: Configure AWS credentials + # uses: aws-actions/configure-aws-credentials@v4 + # with: + # role-to-assume: ${{ secrets.AWS_S3_ARN }} + # aws-region: ap-southeast-2 + # mask-aws-account-id: true - # Step 6: Upload to S3 - - name: Upload to S3 - run: | - aws s3 cp ./dist s3://universal-login-sample-app/ --recursive + # # Step 6: Upload to S3 + # - name: Upload to S3 + # run: | + # aws s3 cp ./dist s3://universal-login-sample-app/ --recursive - name: Manually create test folders under dist/ (for testing only) run: | From a010383fa02cb06eb8e2121eaa653bb1f77c15dc Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 12:34:04 +0530 Subject: [PATCH 03/20] Targeting Pull Request --- .github/workflows/aws-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index cbf4f12..078830f 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -1,6 +1,6 @@ name: Build and Deploy to AWS S3 on: - push: + pull_request: branches: - master # Trigger on PRs targeting 'master' branch types: From d99e2321c8a2911a1ad6c0e3092cb51326f46cea Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 12:35:02 +0530 Subject: [PATCH 04/20] Adding type --- .github/workflows/aws-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 078830f..f673365 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -4,7 +4,8 @@ on: branches: - master # Trigger on PRs targeting 'master' branch types: - - opened + - open + - synchronize workflow_dispatch: jobs: From f93b1002ad62aa9822cd7b27c08ed9c590c14039 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 12:37:22 +0530 Subject: [PATCH 05/20] Removing EOF Line --- .github/workflows/aws-publish.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index f673365..67bb164 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -69,7 +69,7 @@ jobs: for screen_folder in dist/*; do if [ -d "$screen_folder" ]; then screen_name=$(basename "$screen_folder") - cat < "$screen_name-settings.json" + cat > "$screen_name-settings.json" { "rendering_mode": "advanced", "context_configuration": [ @@ -97,7 +97,6 @@ jobs: } ] } - EOF echo "Generated settings file: $screen_name-settings.json" fi done From 4768a3c4d395b8047ac928ace2da424e1e73e6d1 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 12:44:20 +0530 Subject: [PATCH 06/20] Adiing EOF Back --- .github/workflows/aws-publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 67bb164..8603cd7 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -69,7 +69,7 @@ jobs: for screen_folder in dist/*; do if [ -d "$screen_folder" ]; then screen_name=$(basename "$screen_folder") - cat > "$screen_name-settings.json" + cat > "$screen_name-settings.json" << 'EOF' { "rendering_mode": "advanced", "context_configuration": [ @@ -97,6 +97,7 @@ jobs: } ] } + EOF echo "Generated settings file: $screen_name-settings.json" fi done From 871e040d21fe2d56ca98f1f1561d41bae9bd8b85 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 12:49:08 +0530 Subject: [PATCH 07/20] Trying with jq --- .github/workflows/aws-publish.yml | 100 +++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 30 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 8603cd7..0cd1aa4 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -64,44 +64,84 @@ jobs: echo "Created test folders with copied build files:" ls -R dist/ + # - name: Generate settings JSON files dynamically + # run: | + # for screen_folder in dist/*; do + # if [ -d "$screen_folder" ]; then + # screen_name=$(basename "$screen_folder") + # cat > "$screen_name-settings.json" << 'EOF' + # { + # "rendering_mode": "advanced", + # "context_configuration": [ + # "screen.texts", + # "screen.hasCaptcha", + # "screen.captchaImage" + # ], + # "head_tags": [ + # { + # "tag": "script", + # "attributes": { + # "src": "\$CDN_URL/$screen_name/index.js", + # "integrity": "sha384-\$jsHash", + # "crossorigin": "anonymous" + # } + # }, + # { + # "tag": "link", + # "attributes": { + # "href": "\$CDN_URL/$screen_name/index.css", + # "rel": "stylesheet", + # "integrity": "sha384-\$cssHash", + # "crossorigin": "anonymous" + # } + # } + # ] + # } + # EOF + # echo "Generated settings file: $screen_name-settings.json" + # fi + # done + - name: Install jq (if not available) + run: sudo apt-get install jq -y - name: Generate settings JSON files dynamically run: | for screen_folder in dist/*; do if [ -d "$screen_folder" ]; then screen_name=$(basename "$screen_folder") - cat > "$screen_name-settings.json" << 'EOF' - { - "rendering_mode": "advanced", - "context_configuration": [ - "screen.texts", - "screen.hasCaptcha", - "screen.captchaImage" - ], - "head_tags": [ - { - "tag": "script", - "attributes": { - "src": "\$CDN_URL/$screen_name/index.js", - "integrity": "sha384-\$jsHash", - "crossorigin": "anonymous" - } - }, - { - "tag": "link", - "attributes": { - "href": "\$CDN_URL/$screen_name/index.css", - "rel": "stylesheet", - "integrity": "sha384-\$cssHash", - "crossorigin": "anonymous" - } - } - ] - } - EOF + jq -n --arg screen_name "$screen_name" \ + --arg cdn_url "${{ secrets.CDN_URL }}" \ + --arg js_hash "$jsHash" \ + --arg css_hash "$cssHash" \ + '{ + "rendering_mode": "advanced", + "context_configuration": [ + "screen.texts", + "screen.hasCaptcha", + "screen.captchaImage" + ], + "head_tags": [ + { + "tag": "script", + "attributes": { + "src": ($cdn_url + "/" + $screen_name + "/index.js"), + "integrity": ("sha384-" + $js_hash), + "crossorigin": "anonymous" + } + }, + { + "tag": "link", + "attributes": { + "href": ($cdn_url + "/" + $screen_name + "/index.css"), + "rel": "stylesheet", + "integrity": ("sha384-" + $css_hash), + "crossorigin": "anonymous" + } + } + ] + }' > "$screen_name-settings.json" echo "Generated settings file: $screen_name-settings.json" fi done - - name: Update Management API using Auth0 CLI run: | for screen_folder in dist/*; do From f68c84da1aa9feb4205ba54c0fd5ded458680325 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 14:08:47 +0530 Subject: [PATCH 08/20] Changes to last step --- .github/workflows/aws-publish.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 0cd1aa4..bcb7f0a 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -140,14 +140,19 @@ jobs: ] }' > "$screen_name-settings.json" echo "Generated settings file: $screen_name-settings.json" + cat "$screen_name-settings.json" fi done + - name: Install Auth0 CLI via npm + run: | + npm install -g auth0 + auth0 version # Verify installation - name: Update Management API using Auth0 CLI run: | for screen_folder in dist/*; do if [ -d "$screen_folder" ]; then screen_name=$(basename "$screen_folder") - auth0 ui customize --rendering-mode advanced --prompt login-id --screen $screen_name --settings-file "./$screen_name-settings.json" + auth0 ul customize --rendering-mode advanced --prompt login-id --screen $screen_name --settings-file "./$screen_name-settings.json" echo "Updated Auth0 UI for screen: $screen_name" fi done \ No newline at end of file From bd2aa4f157f1404dec86a5013d141e05044e07a2 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 14:11:59 +0530 Subject: [PATCH 09/20] Installing auth0 --- .github/workflows/aws-publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index bcb7f0a..53a696d 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -143,10 +143,11 @@ jobs: cat "$screen_name-settings.json" fi done - - name: Install Auth0 CLI via npm + - name: Install Auth0 CLI using Homebrew run: | - npm install -g auth0 + brew install auth0 auth0 version # Verify installation + - name: Update Management API using Auth0 CLI run: | for screen_folder in dist/*; do From 879158ff082234e39ddcb6f9905f0353a3c93122 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 14:21:12 +0530 Subject: [PATCH 10/20] Auth0cli --- .github/workflows/aws-publish.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 53a696d..48ab970 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -143,10 +143,14 @@ jobs: cat "$screen_name-settings.json" fi done - - name: Install Auth0 CLI using Homebrew + - name: Install Auth0 CLI run: | - brew install auth0 - auth0 version # Verify installation + # Download and install Auth0 CLI + curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh | sh -s -- -b . + # Move it to /usr/local/bin for system-wide access + sudo mv ./auth0 /usr/local/bin/ + # Verify installation + auth0 version - name: Update Management API using Auth0 CLI run: | From 2bb0ffd9c75b56f15ab7b435b25fd1754eceab59 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Tue, 18 Feb 2025 14:22:30 +0530 Subject: [PATCH 11/20] Removing the version Check --- .github/workflows/aws-publish.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 48ab970..f3a1db5 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -149,8 +149,7 @@ jobs: curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh | sh -s -- -b . # Move it to /usr/local/bin for system-wide access sudo mv ./auth0 /usr/local/bin/ - # Verify installation - auth0 version + - name: Update Management API using Auth0 CLI run: | From 10ba1a8c445de9aa39961be997d1630b84a5f67d Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Wed, 19 Feb 2025 16:46:15 +0530 Subject: [PATCH 12/20] Giving the Auth0 AUthentication --- .github/workflows/aws-publish.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index f3a1db5..502fda3 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -150,6 +150,13 @@ jobs: # Move it to /usr/local/bin for system-wide access sudo mv ./auth0 /usr/local/bin/ + - name: Authorize with Tenant Details + run: | + auth0 login \ + --domain ${{ secrets.AUTH0_DOMAIN }} \ + --client-id ${{ secrets.AUTH0_CLIENT_ID }} \ + --client-secret ${{ secrets.AUTH0_CLIENT_SECRET }} + - name: Update Management API using Auth0 CLI run: | @@ -159,4 +166,9 @@ jobs: auth0 ul customize --rendering-mode advanced --prompt login-id --screen $screen_name --settings-file "./$screen_name-settings.json" echo "Updated Auth0 UI for screen: $screen_name" fi - done \ No newline at end of file + done + + - name: Logout The Tenant + run: | + auth0 logout \ + --domain ${{ secrets.AUTH0_DOMAIN }} \ No newline at end of file From 5796c2e1e3820811eed76888e0a66debfc161b24 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Wed, 19 Feb 2025 17:13:33 +0530 Subject: [PATCH 13/20] Checking domain --- .github/workflows/aws-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 502fda3..761cf68 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -156,6 +156,7 @@ jobs: --domain ${{ secrets.AUTH0_DOMAIN }} \ --client-id ${{ secrets.AUTH0_CLIENT_ID }} \ --client-secret ${{ secrets.AUTH0_CLIENT_SECRET }} + auth0 domain list - name: Update Management API using Auth0 CLI From e1e1dcf04b46cc0101af3c8ff4e2b0679795ea04 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Wed, 19 Feb 2025 17:42:33 +0530 Subject: [PATCH 14/20] List the domains --- .github/workflows/aws-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 761cf68..41de70a 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -156,7 +156,7 @@ jobs: --domain ${{ secrets.AUTH0_DOMAIN }} \ --client-id ${{ secrets.AUTH0_CLIENT_ID }} \ --client-secret ${{ secrets.AUTH0_CLIENT_SECRET }} - auth0 domain list + auth0 domains list - name: Update Management API using Auth0 CLI From da687a89928652952b2c260491ab71b706e3fe45 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Wed, 19 Feb 2025 17:45:35 +0530 Subject: [PATCH 15/20] Fixing the syntax --- .github/workflows/aws-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 41de70a..2260347 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -124,7 +124,7 @@ jobs: "tag": "script", "attributes": { "src": ($cdn_url + "/" + $screen_name + "/index.js"), - "integrity": ("sha384-" + $js_hash), + "integrity": [("sha384-" + $js_hash)], "crossorigin": "anonymous" } }, @@ -133,7 +133,7 @@ jobs: "attributes": { "href": ($cdn_url + "/" + $screen_name + "/index.css"), "rel": "stylesheet", - "integrity": ("sha384-" + $css_hash), + "integrity": [("sha384-" + $css_hash)], "crossorigin": "anonymous" } } From bd6d01e1bf7f98658b59e8994c92527fbe100ab1 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Wed, 19 Feb 2025 17:50:21 +0530 Subject: [PATCH 16/20] Changing contextConfiguration --- .github/workflows/aws-publish.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 2260347..8f86ef2 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -115,9 +115,8 @@ jobs: '{ "rendering_mode": "advanced", "context_configuration": [ - "screen.texts", - "screen.hasCaptcha", - "screen.captchaImage" + "branding.settings", + "branding.themes.default", ], "head_tags": [ { From 1182f4aac6c77ba74a443c862bcf4ba04ea8cfed Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Wed, 19 Feb 2025 17:51:41 +0530 Subject: [PATCH 17/20] Formatted Into JSON --- .github/workflows/aws-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 8f86ef2..3060487 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -116,7 +116,7 @@ jobs: "rendering_mode": "advanced", "context_configuration": [ "branding.settings", - "branding.themes.default", + "branding.themes.default" ], "head_tags": [ { From a726be4b9aec761027499d71c4e68f487defb200 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Thu, 20 Feb 2025 01:16:38 +0530 Subject: [PATCH 18/20] Reverting the test code --- .github/workflows/aws-publish.yml | 42 +++---------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index 3060487..a86cdf5 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -64,45 +64,9 @@ jobs: echo "Created test folders with copied build files:" ls -R dist/ - # - name: Generate settings JSON files dynamically - # run: | - # for screen_folder in dist/*; do - # if [ -d "$screen_folder" ]; then - # screen_name=$(basename "$screen_folder") - # cat > "$screen_name-settings.json" << 'EOF' - # { - # "rendering_mode": "advanced", - # "context_configuration": [ - # "screen.texts", - # "screen.hasCaptcha", - # "screen.captchaImage" - # ], - # "head_tags": [ - # { - # "tag": "script", - # "attributes": { - # "src": "\$CDN_URL/$screen_name/index.js", - # "integrity": "sha384-\$jsHash", - # "crossorigin": "anonymous" - # } - # }, - # { - # "tag": "link", - # "attributes": { - # "href": "\$CDN_URL/$screen_name/index.css", - # "rel": "stylesheet", - # "integrity": "sha384-\$cssHash", - # "crossorigin": "anonymous" - # } - # } - # ] - # } - # EOF - # echo "Generated settings file: $screen_name-settings.json" - # fi - # done - name: Install jq (if not available) run: sudo apt-get install jq -y + - name: Generate settings JSON files dynamically run: | for screen_folder in dist/*; do @@ -142,6 +106,7 @@ jobs: cat "$screen_name-settings.json" fi done + - name: Install Auth0 CLI run: | # Download and install Auth0 CLI @@ -157,7 +122,6 @@ jobs: --client-secret ${{ secrets.AUTH0_CLIENT_SECRET }} auth0 domains list - - name: Update Management API using Auth0 CLI run: | for screen_folder in dist/*; do @@ -171,4 +135,4 @@ jobs: - name: Logout The Tenant run: | auth0 logout \ - --domain ${{ secrets.AUTH0_DOMAIN }} \ No newline at end of file + ${{ secrets.AUTH0_DOMAIN }} \ No newline at end of file From 14ac7cd5d6bfc91a3de134797de84ff544dfd551 Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Thu, 20 Feb 2025 12:28:08 +0530 Subject: [PATCH 19/20] Removing Logout --- .github/workflows/aws-publish.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index a86cdf5..fc0be45 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -66,7 +66,7 @@ jobs: - name: Install jq (if not available) run: sudo apt-get install jq -y - + - name: Generate settings JSON files dynamically run: | for screen_folder in dist/*; do @@ -120,7 +120,6 @@ jobs: --domain ${{ secrets.AUTH0_DOMAIN }} \ --client-id ${{ secrets.AUTH0_CLIENT_ID }} \ --client-secret ${{ secrets.AUTH0_CLIENT_SECRET }} - auth0 domains list - name: Update Management API using Auth0 CLI run: | @@ -130,9 +129,4 @@ jobs: auth0 ul customize --rendering-mode advanced --prompt login-id --screen $screen_name --settings-file "./$screen_name-settings.json" echo "Updated Auth0 UI for screen: $screen_name" fi - done - - - name: Logout The Tenant - run: | - auth0 logout \ - ${{ secrets.AUTH0_DOMAIN }} \ No newline at end of file + done \ No newline at end of file From ef1bb564a7b45463082c5e2dc1b928f7a422b49d Mon Sep 17 00:00:00 2001 From: Snehil Kishore Date: Thu, 20 Feb 2025 21:48:23 +0530 Subject: [PATCH 20/20] Commenting out the recent changes --- .github/workflows/aws-publish.yml | 174 +++++++++++++++--------------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/.github/workflows/aws-publish.yml b/.github/workflows/aws-publish.yml index fc0be45..502a880 100644 --- a/.github/workflows/aws-publish.yml +++ b/.github/workflows/aws-publish.yml @@ -36,97 +36,97 @@ jobs: run: npm run build # Step 5: Configure AWS credentials via OIDC - # - name: Configure AWS credentials - # uses: aws-actions/configure-aws-credentials@v4 - # with: - # role-to-assume: ${{ secrets.AWS_S3_ARN }} - # aws-region: ap-southeast-2 - # mask-aws-account-id: true - - # # Step 6: Upload to S3 - # - name: Upload to S3 - # run: | - # aws s3 cp ./dist s3://universal-login-sample-app/ --recursive + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_S3_ARN }} + aws-region: ap-southeast-2 + mask-aws-account-id: true - - name: Manually create test folders under dist/ (for testing only) + # Step 6: Upload to S3 + - name: Upload to S3 run: | - mkdir -p dist/loginid - mkdir -p dist/login - # Copy the existing built files into these folders - cp dist/index.js dist/loginid/index.js - cp dist/index.css dist/loginid/index.css - cp dist/index.html dist/loginid/index.html - cp dist/*.png dist/loginid/ - cp dist/index.js dist/login/index.js - cp dist/index.css dist/login/index.css - cp dist/index.html dist/login/index.html - cp dist/*.png dist/login/ - echo "Created test folders with copied build files:" - ls -R dist/ + aws s3 cp ./dist s3://universal-login-sample-app/ --recursive - - name: Install jq (if not available) - run: sudo apt-get install jq -y + # - name: Manually create test folders under dist/ (for testing only) + # run: | + # mkdir -p dist/loginid + # mkdir -p dist/login + # # Copy the existing built files into these folders + # cp dist/index.js dist/loginid/index.js + # cp dist/index.css dist/loginid/index.css + # cp dist/index.html dist/loginid/index.html + # cp dist/*.png dist/loginid/ + # cp dist/index.js dist/login/index.js + # cp dist/index.css dist/login/index.css + # cp dist/index.html dist/login/index.html + # cp dist/*.png dist/login/ + # echo "Created test folders with copied build files:" + # ls -R dist/ - - name: Generate settings JSON files dynamically - run: | - for screen_folder in dist/*; do - if [ -d "$screen_folder" ]; then - screen_name=$(basename "$screen_folder") - jq -n --arg screen_name "$screen_name" \ - --arg cdn_url "${{ secrets.CDN_URL }}" \ - --arg js_hash "$jsHash" \ - --arg css_hash "$cssHash" \ - '{ - "rendering_mode": "advanced", - "context_configuration": [ - "branding.settings", - "branding.themes.default" - ], - "head_tags": [ - { - "tag": "script", - "attributes": { - "src": ($cdn_url + "/" + $screen_name + "/index.js"), - "integrity": [("sha384-" + $js_hash)], - "crossorigin": "anonymous" - } - }, - { - "tag": "link", - "attributes": { - "href": ($cdn_url + "/" + $screen_name + "/index.css"), - "rel": "stylesheet", - "integrity": [("sha384-" + $css_hash)], - "crossorigin": "anonymous" - } - } - ] - }' > "$screen_name-settings.json" - echo "Generated settings file: $screen_name-settings.json" - cat "$screen_name-settings.json" - fi - done + # - name: Install jq (if not available) + # run: sudo apt-get install jq -y - - name: Install Auth0 CLI - run: | - # Download and install Auth0 CLI - curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh | sh -s -- -b . - # Move it to /usr/local/bin for system-wide access - sudo mv ./auth0 /usr/local/bin/ + # - name: Generate settings JSON files dynamically + # run: | + # for screen_folder in dist/*; do + # if [ -d "$screen_folder" ]; then + # screen_name=$(basename "$screen_folder") + # jq -n --arg screen_name "$screen_name" \ + # --arg cdn_url "${{ secrets.CDN_URL }}" \ + # --arg js_hash "$jsHash" \ + # --arg css_hash "$cssHash" \ + # '{ + # "rendering_mode": "advanced", + # "context_configuration": [ + # "branding.settings", + # "branding.themes.default" + # ], + # "head_tags": [ + # { + # "tag": "script", + # "attributes": { + # "src": ($cdn_url + "/" + $screen_name + "/index.js"), + # "integrity": [("sha384-" + $js_hash)], + # "crossorigin": "anonymous" + # } + # }, + # { + # "tag": "link", + # "attributes": { + # "href": ($cdn_url + "/" + $screen_name + "/index.css"), + # "rel": "stylesheet", + # "integrity": [("sha384-" + $css_hash)], + # "crossorigin": "anonymous" + # } + # } + # ] + # }' > "$screen_name-settings.json" + # echo "Generated settings file: $screen_name-settings.json" + # cat "$screen_name-settings.json" + # fi + # done - - name: Authorize with Tenant Details - run: | - auth0 login \ - --domain ${{ secrets.AUTH0_DOMAIN }} \ - --client-id ${{ secrets.AUTH0_CLIENT_ID }} \ - --client-secret ${{ secrets.AUTH0_CLIENT_SECRET }} + # - name: Install Auth0 CLI + # run: | + # # Download and install Auth0 CLI + # curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh | sh -s -- -b . + # # Move it to /usr/local/bin for system-wide access + # sudo mv ./auth0 /usr/local/bin/ - - name: Update Management API using Auth0 CLI - run: | - for screen_folder in dist/*; do - if [ -d "$screen_folder" ]; then - screen_name=$(basename "$screen_folder") - auth0 ul customize --rendering-mode advanced --prompt login-id --screen $screen_name --settings-file "./$screen_name-settings.json" - echo "Updated Auth0 UI for screen: $screen_name" - fi - done \ No newline at end of file + # - name: Authorize with Tenant Details + # run: | + # auth0 login \ + # --domain ${{ secrets.AUTH0_DOMAIN }} \ + # --client-id ${{ secrets.AUTH0_CLIENT_ID }} \ + # --client-secret ${{ secrets.AUTH0_CLIENT_SECRET }} + + # - name: Update Management API using Auth0 CLI + # run: | + # for screen_folder in dist/*; do + # if [ -d "$screen_folder" ]; then + # screen_name=$(basename "$screen_folder") + # auth0 ul customize --rendering-mode advanced --prompt login-id --screen $screen_name --settings-file "./$screen_name-settings.json" + # echo "Updated Auth0 UI for screen: $screen_name" + # fi + # done \ No newline at end of file