Skip to content

fix(setup): harden device code OAuth flow and secret propagation - #231

Merged
JohnDuprey merged 2 commits into
devfrom
fix/setup-wizard-auth
Aug 10, 2026
Merged

fix(setup): harden device code OAuth flow and secret propagation#231
JohnDuprey merged 2 commits into
devfrom
fix/setup-wizard-auth

Conversation

@JohnDuprey

Copy link
Copy Markdown
Contributor
  • Fix authority mismatch in New-DeviceLogin where poll used /organizations but request honoured TenantId
  • Deduplicate OIDC scopes instead of appending them unconditionally
  • Return full token endpoint response so AADSTS codes surface instead of being swallowed
  • Add client ID and scope allowlist to ExecDeviceCodeLogon to prevent token brokering
  • Expose terminal poll errors (expired code, CA block) instead of reporting everything as pending
  • Add ExecSamSecretStatus endpoint to detect AADSTS7000215 secret propagation delays
  • Block the sign-in step in CippTenantModeDeploy until the secret is usable
  • Fix PKCE to use S256 instead of plain, open popup before async digest to preserve user activation
  • Switch authority from /common to /organizations and prompt from select_account to login
  • Track device login popup closure and offer restart rather than locking the button
  • Cancel grace-period close timer in cleanup to prevent false cancellation on next attempt
  • Add sign-in log check in Test-CIPPAccessPermissions to detect device code token families
  • Delete unused CIPPDeviceCodeButton.js
  • Add crypto.subtle stub and digest mock to test environment for PKCE tests

- Fix authority mismatch in New-DeviceLogin where poll used /organizations but request honoured TenantId
- Deduplicate OIDC scopes instead of appending them unconditionally
- Return full token endpoint response so AADSTS codes surface instead of being swallowed
- Add client ID and scope allowlist to ExecDeviceCodeLogon to prevent token brokering
- Expose terminal poll errors (expired code, CA block) instead of reporting everything as pending
- Add ExecSamSecretStatus endpoint to detect AADSTS7000215 secret propagation delays
- Block the sign-in step in CippTenantModeDeploy until the secret is usable
- Fix PKCE to use S256 instead of plain, open popup before async digest to preserve user activation
- Switch authority from /common to /organizations and prompt from select_account to login
- Track device login popup closure and offer restart rather than locking the button
- Cancel grace-period close timer in cleanup to prevent false cancellation on next attempt
- Add sign-in log check in Test-CIPPAccessPermissions to detect device code token families
- Delete unused CIPPDeviceCodeButton.js
- Add crypto.subtle stub and digest mock to test environment for PKCE tests
Adds OpenAPI spec for the ExecSamSecretStatus endpoint used by the setup wizard to poll whether a newly created SAM application secret has replicated in Entra before proceeding. Also adds a 400 response to an existing endpoint.
@JohnDuprey
JohnDuprey merged commit 8a58882 into dev Aug 10, 2026
10 checks passed
@JohnDuprey
JohnDuprey deleted the fix/setup-wizard-auth branch August 10, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant