Skip to content

Add provisionResourceAccountCredentials API to Common's DRCA, Fixes AB#3450074#3086

Open
mohitc1 wants to merge 3 commits intodevfrom
mchand/provision-resource-account
Open

Add provisionResourceAccountCredentials API to Common's DRCA, Fixes AB#3450074#3086
mohitc1 wants to merge 3 commits intodevfrom
mchand/provision-resource-account

Conversation

@mohitc1
Copy link
Copy Markdown
Contributor

@mohitc1 mohitc1 commented Apr 17, 2026

Summary

Adds the provisionResourceAccountCredentials IPC API to DeviceRegistrationClientApplication (DRCA) enabling OneAuth consumers to provision resource account credentials via the broker. Also adds Teams IP Phone (Sakurai) app entries to AppRegistry.

Changes

New API: provisionResourceAccountCredentials

  • Added provisionResourceAccountCredentials(tenantId, raObjectId, correlationId, sdkType, sdkVersion) to DeviceRegistrationClientApplication
  • sdkType (SdkType) and sdkVersion (String) are required parameters
  • Returns an AccountRecord for the provisioned resource account

Protocol Files

  • Added ProvisionResourceAccountCredentialsV0Parameters — V0 wire params (correlationId, tenantId, raObjectId, sdkType, sdkVersion)
  • Added ProvisionResourceAccountCredentialsV0Response — V0 wire response carrying AccountRecord
  • Renamed protocol constant to PROVISION_RESOURCE_ACCOUNT_CREDENTIALS_V0

AppRegistry

  • Added IPPHONE_PROD and IPPHONE_DEBUG entries for Teams IP Phone (Sakurai) devices using existing constants from AuthenticationConstants

Tests

  • Added provisionResourceAccountCredentials_returnsAccountRecord unit test to DeviceRegistrationClientApplicationTest

Files Changed

File Change
DeviceRegistrationClientApplication.kt New provisionResourceAccountCredentials method
ProvisionResourceAccountCredentialsV0Parameters.java New V0 protocol params (Java + Lombok)
ProvisionResourceAccountCredentialsV0Response.java New V0 protocol response (Java + Lombok)
DeviceRegistrationProtocolConstants.java Renamed constant
AppRegistry.kt Added IPPhone entries
DeviceRegistrationClientApplicationTest.kt New unit test
changelog.txt Added vNext entry

Companion PR

Work Item

Fixes AB#3450074

- Add provisionResourceAccountCredentials to DeviceRegistrationClientApplication
- Add ProvisionResourceAccountCredentialsV0Parameters and V0Response
- Rename protocol constant to PROVISION_RESOURCE_ACCOUNT_CREDENTIALS_V0
- Add IPPHONE_PROD and IPPHONE_DEBUG entries to AppRegistry
- Add unit test for provisionResourceAccountCredentials
- Make sdkType and sdkVersion required params

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

…hone

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mohitc1 mohitc1 force-pushed the mchand/provision-resource-account branch from 42ffda5 to 55711fb Compare April 17, 2026 05:45
@github-actions
Copy link
Copy Markdown

✅ Work item link check complete. Description contains link AB#3450074 to an Azure Boards work item.

@github-actions
Copy link
Copy Markdown

❌ Work item link check failed. Description contains AB#3450074 but the Bot could not link it to an Azure Boards work item.

Click here to learn more.

@github-actions github-actions bot changed the title Add provisionResourceAccountCredentials API to Common's DRCA Add provisionResourceAccountCredentials API to Common's DRCA, Fixes AB#3450074 Apr 17, 2026
@mohitc1 mohitc1 marked this pull request as ready for review April 17, 2026 06:32
@mohitc1 mohitc1 requested review from a team as code owners April 17, 2026 06:32
Copilot AI review requested due to automatic review settings April 17, 2026 06:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new DRCA (DeviceRegistrationClientApplication) IPC surface to provision resource account credentials via broker, and expands the app allow-list to recognize Teams IP Phone (Sakurai) packages. This fits into Common’s device registration/broker IPC layer by introducing a new V0 protocol params/response pair and exposing a public Kotlin API to invoke it.

Changes:

  • Added provisionResourceAccountCredentials(...) to DeviceRegistrationClientApplication, returning an AccountRecord.
  • Introduced new V0 protocol parameter/response types and a new protocol constant string.
  • Added Teams IP Phone prod/debug app entries to AppRegistry and a new unit test + changelog entry.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
common/src/main/java/com/microsoft/identity/deviceregistration/api/DeviceRegistrationClientApplication.kt Exposes new DRCA API and wires it to the controller/IPC protocol packer.
common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/ProvisionResourceAccountCredentialsV0Parameters.java Defines the V0 wire parameters for the new broker IPC operation.
common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/ProvisionResourceAccountCredentialsV0Response.java Defines the V0 wire response carrying the provisioned AccountRecord.
common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/DeviceRegistrationProtocolConstants.java Adds/renames the protocol name constant used for the new operation.
common/src/main/java/com/microsoft/identity/common/internal/apps/AppRegistry.kt Adds Teams IP Phone prod/debug apps to the authorized app registry.
common/src/test/java/com/microsoft/identity/deviceregistration/api/DeviceRegistrationClientApplicationTest.kt Adds a unit test for the new DRCA API happy path.
changelog.txt Documents the new API and AppRegistry additions under vNext.
Comments suppressed due to low confidence (1)

common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/ProvisionResourceAccountCredentialsV0Parameters.java:81

  • The public DRCA API requires sdkType and sdkVersion, but the wire parameters model allows both to be null (@Nullable). This creates an inconsistent contract across layers and makes it easier to accidentally send incomplete IPC payloads. Align the nullability with the intended requirement (prefer @NonNull for both), or explicitly document/handle null as a supported scenario (e.g., legacy callers).

…arams test

- Remove unnecessary @jvmoverloads annotation (no default params)
- Update KDoc to say 'required' instead of 'optional' for sdkType/sdkVersion
- Change sdkType?.name to sdkType.name (non-null safe call redundant)
- Add test verifying sdkType and sdkVersion are passed through to IPC params

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants