Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6843fe0
docs: add technical plan for Azure B2C media user creation (#346)
github-actions[bot] Feb 12, 2026
59db90c
Merge branch 'master' into feature/346-azure-b2c-media-user-creation
ChrisS1512 Feb 19, 2026
e21d33f
Feature 346 - B2C Account Creation Integration
ChrisS1512 Feb 23, 2026
2f73b15
346 - Fixed Code Rabbit suggestions
ChrisS1512 Feb 24, 2026
e86469e
Merge branch 'master' into feature/346-azure-b2c-media-user-creation
ChrisS1512 Feb 24, 2026
f4760e6
346 - Added Mocks
ChrisS1512 Feb 24, 2026
bac24c2
346 - Validate MEDIA_FORGOT_PASSWORD_LINK before approving application
NatashaAlker Mar 18, 2026
946e551
346 - Update existing Azure AD user and local DB on media approval
NatashaAlker Mar 18, 2026
476d8f1
346 - Clear stale rejection reasons from session on page load
NatashaAlker Mar 30, 2026
036d135
Merge branch 'master' into feature/346-azure-b2c-media-user-creation
KianKwa Apr 16, 2026
2fcd67e
Use duplicate email template for existing media users
KianKwa Apr 16, 2026
ba38810
Linting fix
KianKwa Apr 16, 2026
96b2c7f
FIx coderabbit comments
KianKwa Apr 17, 2026
73fda65
Move code to different lib
KianKwa Apr 17, 2026
8b22030
Lint fixes
KianKwa Apr 17, 2026
30c930f
Update reset password link
KianKwa Apr 17, 2026
2be05f0
Merge remote-tracking branch 'origin/master' into feature/346-azure-b…
KianKwa Apr 30, 2026
58285fe
Removed redundant e2e test file
KianKwa May 5, 2026
c8cebd8
Merge branch 'master' into feature/346-azure-b2c-media-user-creation
junaidiqbalmoj May 7, 2026
9a112ba
fix build
junaidiqbalmoj May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ jobs:
AZURE_API_CLIENT_SECRET: ${{ secrets.APP_PIP_DATA_MANAGEMENT_PWD }}
APP_PIP_DATA_MANAGEMENT_SCOPE: ${{ secrets.APP_PIP_DATA_MANAGEMENT_SCOPE }}

# Azure B2C Configuration (mocked in CI until delete endpoint is deployed)
MOCK_AZURE_B2C: "true"
MEDIA_FORGOT_PASSWORD_LINK: "https://localhost:8080/forgot-password"

# GOV.UK Notify Configuration (for notification E2E tests)
GOVUK_NOTIFY_API_KEY: ${{ secrets.GOVUK_NOTIFY_API_KEY }}
GOVUK_NOTIFY_TEMPLATE_ID_SUBSCRIPTION: ${{ secrets.GOVUK_NOTIFY_TEMPLATE_ID_SUBSCRIPTION }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ jobs:
AZURE_CLIENT_ID: ${{ secrets.APP_PIP_DATA_MANAGEMENT_ID }}
APP_PIP_DATA_MANAGEMENT_SCOPE: ${{ secrets.APP_PIP_DATA_MANAGEMENT_SCOPE }}

# Azure B2C Configuration (mocked in CI until delete endpoint is deployed)
MOCK_AZURE_B2C: "true"
MEDIA_FORGOT_PASSWORD_LINK: "https://localhost:8080/forgot-password"

steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
12 changes: 11 additions & 1 deletion apps/web/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,21 @@ APPLICATION_INSIGHTS_CONNECTION_STRING=InstrumentationKey=your-instrumentation-k
# API key and template IDs for sending notification emails
# Get these from: https://www.notifications.service.gov.uk/
GOVUK_NOTIFY_API_KEY=your-api-key-here
GOVUK_NOTIFY_TEMPLATE_ID_MEDIA_APPROVAL=template-uuid-here
GOVUK_NOTIFY_TEMPLATE_ID_MEDIA_REJECTION=template-uuid-here
GOVUK_NOTIFY_TEMPLATE_ID_MEDIA_NEW_ACCOUNT=template-uuid-here
GOVUK_NOTIFY_TEMPLATE_ID_MEDIA_EXISTING_USER=template-uuid-here
GOVUK_NOTIFY_TEMPLATE_ID_SUBSCRIPTION=template-uuid-here
GOVUK_NOTIFY_TEMPLATE_ID_SUBSCRIPTION_PDF_AND_SUMMARY=template-uuid-here
GOVUK_NOTIFY_TEMPLATE_ID_SUBSCRIPTION_SUMMARY_ONLY=template-uuid-here

# Media User Links (full URLs, environment-dependent)
MEDIA_FORGOT_PASSWORD_LINK=
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
MEDIA_SUBSCRIPTION_PAGE_LINK=
MEDIA_START_PAGE_LINK=

# Azure AD B2C Service Principal (client credentials flow)
# AZURE_B2C_TENANT_ID, AZURE_B2C_CLIENT_ID, AZURE_B2C_CLIENT_SECRET, AZURE_B2C_DOMAIN loaded from Key Vault
# See helm/values.yaml for Key Vault secret mappings

# Service URL for generating links in notifications
CATH_SERVICE_URL=https://www.court-tribunal-hearings.service.gov.uk
18 changes: 18 additions & 0 deletions apps/web/helm/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ nodejs:
BASE_URL: 'https://{{ .Values.nodejs.ingressHost }}'
SSO_ALLOW_HTTP_REDIRECT: 'false'
CFT_IDAM_URL: 'https://idam-web-public.aat.platform.hmcts.net'
MEDIA_FORGOT_PASSWORD_LINK: 'https://sign-in.pip-frontend.staging.platform.hmcts.net/pip-frontend.staging.platform.hmcts.net/oauth2/v2.0/authorize?p=B2C_1A_PASSWORD_RESET&client_id=cae650ba-431b-4fc8-be14-22d476ebd31b&nonce=defaultNonce&redirect_uri=https://pip-frontend.staging.platform.hmcts.net/password-change-confirmation&scope=openid&response_type=code&prompt=login&response_mode=form_post'
GOVUK_NOTIFY_TEMPLATE_ID_MEDIA_REJECTION: '1988bbdd-d223-49bf-912f-ed34cb43e35e'
GOVUK_NOTIFY_TEMPLATE_ID_MEDIA_NEW_ACCOUNT: '689c0183-0461-423e-a542-de513a93a5b7'
GOVUK_NOTIFY_TEMPLATE_ID_MEDIA_EXISTING_USER: '13b058a5-82da-4331-98ff-97d3ebf66f51'
keyVaults:
# Local development uses pip-ss-kv-stg with -dev suffixed secrets
pip-ss-kv-stg:
Expand All @@ -33,3 +37,17 @@ nodejs:
# CFT IDAM secret for local development
- name: cft-idam-client-secret
alias: CFT_IDAM_CLIENT_SECRET

# GOV.UK Notify
- name: gov-uk-notify-test-api-key
alias: GOVUK_NOTIFY_API_KEY

# Azure AD B2C secrets (media user account management)
- name: b2c-tenant-id
alias: AZURE_B2C_TENANT_ID
- name: auto-pip-stg-pip-account-management-stg-id
alias: AZURE_B2C_CLIENT_ID
- name: auto-pip-stg-pip-account-management-stg-pwd
alias: AZURE_B2C_CLIENT_SECRET
- name: b2c-ad-url
alias: AZURE_B2C_DOMAIN
14 changes: 14 additions & 0 deletions apps/web/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ nodejs:
REDIS_HOST: 'cath-{{ .Values.global.environment }}.redis.cache.windows.net'
BASE_URL: 'https://{{ .Values.nodejs.ingressHost }}'
SSO_ALLOW_HTTP_REDIRECT: 'false'
MEDIA_FORGOT_PASSWORD_LINK: 'https://sign-in.pip-frontend.staging.platform.hmcts.net/pip-frontend.staging.platform.hmcts.net/oauth2/v2.0/authorize?p=B2C_1A_PASSWORD_RESET&client_id=cae650ba-431b-4fc8-be14-22d476ebd31b&nonce=defaultNonce&redirect_uri=https://pip-frontend.staging.platform.hmcts.net/password-change-confirmation&scope=openid&response_type=code&prompt=login&response_mode=form_post'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

MEDIA_FORGOT_PASSWORD_LINK is hardcoded to a staging endpoint in a file used for production deployments.

The URL contains staging.platform.hmcts.net multiple times. Since values.yaml is described as being used by Flux for both non-prod and prod deployments, production users approving media applications will receive emails with a link pointing at the staging B2C password-reset endpoint.

This should either use a Helm template expression (e.g., {{ .Values.global.environment }}) or be overridden per-environment in separate values.<env>.yaml files.

GOVUK_NOTIFY_TEMPLATE_ID_MEDIA_REJECTION: '1988bbdd-d223-49bf-912f-ed34cb43e35e'
GOVUK_NOTIFY_TEMPLATE_ID_MEDIA_NEW_ACCOUNT: '689c0183-0461-423e-a542-de513a93a5b7'
GOVUK_NOTIFY_TEMPLATE_ID_MEDIA_EXISTING_USER: '13b058a5-82da-4331-98ff-97d3ebf66f51'
keyVaults:
# Using pip-ss-kv-stg for time being, once pipeline properly setup, stg will be replaced by environment
pip-ss-kv-stg:
Expand All @@ -42,3 +46,13 @@ nodejs:
alias: SSO_INTERNAL_ADMIN_CTSC_GROUP_ID
- name: sso-sg-admin-local
alias: SSO_INTERNAL_ADMIN_LOCAL_GROUP_ID

# Azure AD B2C secrets (media user account management)
- name: b2c-tenant-id
alias: AZURE_B2C_TENANT_ID
- name: auto-pip-stg-pip-account-management-stg-id
alias: AZURE_B2C_CLIENT_ID
- name: auto-pip-stg-pip-account-management-stg-pwd
alias: AZURE_B2C_CLIENT_SECRET
- name: b2c-ad-url
alias: AZURE_B2C_DOMAIN
Loading
Loading