Add GET_DEVICE_TOKEN_V1 protocol with required clientId parameter, Fixes AB#3658756#3147
Add GET_DEVICE_TOKEN_V1 protocol with required clientId parameter, Fixes AB#3658756#3147mohitc1 wants to merge 8 commits into
Conversation
- Add GET_DEVICE_TOKEN_V1 protocol constant - New GetDeviceTokenV1Parameters with @nonnull clientId field - New GetDeviceTokenV1Response - New getDeviceToken overload accepting clientId in DeviceRegistrationClientApplication - Deprecate old getDeviceToken overload (V0, no clientId) - Unit tests for V1 parameters serialization and DRCA integration AB#3658756
|
✅ Work item link check complete. Description contains link AB#3658756 to an Azure Boards work item. |
There was a problem hiding this comment.
Pull request overview
This PR extends the device registration IPC/protocol surface to support a new GET_DEVICE_TOKEN_V1 protocol that requires a clientId, and updates DeviceRegistrationClientApplication to expose a new getDeviceToken overload using V1 while deprecating the legacy V0 overload.
Changes:
- Add
GET_DEVICE_TOKEN_V1protocol constant plus new V1 protocol parameter/response types (GetDeviceTokenV1Parameters,GetDeviceTokenV1Response). - Add a new
DeviceRegistrationClientApplication.getDeviceToken(..., clientId, scope)overload and deprecate the V0 overload. - Add/extend unit tests for V1 serialization and DRCA integration; update
changelog.txt.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| common4j/src/test/com/microsoft/identity/deviceregistration/java/protocol/parameters/GetDeviceTokenV1ParametersTest.kt | Adds unit tests validating V1 parameter serialization/deserialization and getters. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/response/GetDeviceTokenV1Response.java | Introduces the V1 protocol response payload for returning a device token. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/parameters/GetDeviceTokenV1Parameters.java | Introduces the V1 protocol parameters including required clientId. |
| common4j/src/main/com/microsoft/identity/deviceregistration/java/protocol/DeviceRegistrationProtocolConstants.java | Adds the GET_DEVICE_TOKEN_V1 protocol constant. |
| common/src/test/java/com/microsoft/identity/deviceregistration/api/DeviceRegistrationClientApplicationTest.kt | Adds DRCA integration tests for V1 and validates V0 deprecated behavior. |
| common/src/main/java/com/microsoft/identity/deviceregistration/api/DeviceRegistrationClientApplication.kt | Adds V1 overload, deprecates V0 overload, and routes execution to the correct protocol types. |
| changelog.txt | Adds a vNext release note entry for the new V1 protocol and V0 deprecation. |
… app registry - Restore @jvmoverloads and default scope=null on deprecated getDeviceToken - Remove invalid replaceWith referencing out-of-scope clientId - Add MDE (com.microsoft.scmx) to GET_DEVICE_TOKEN_AUTHORIZED_APPS and SSO_TOKEN_AUTHORIZED_APPS - Add PR number to changelog entry
- Add @nonnull redirectUri field to GetDeviceTokenV1Parameters - Add redirectUri param to DeviceRegistrationClientApplication.getDeviceToken V1 overload - Update tests to include redirectUri
| val methodTag = "$TAG:getDeviceToken" | ||
| Logger.info(methodTag, "GetDeviceToken (V1) started. CorrelationId: $correlationId") | ||
| val responseSerialized = mController.execute( | ||
| GetDeviceTokenV1Parameters(correlationId, deviceRegistrationRecord, resources, clientId, redirectUri, scope) |
There was a problem hiding this comment.
what happens when this V1 overload is called against a broker that doesn't have the V1 executor yet?
i looked locally and neither DeviceRegistrationProtocolExecutorFactory nor the WpjLegacy one has a GET_DEVICE_TOKEN_V1 case, so the call would throw BrokerUpdateRequiredException. is the plan to ship the broker companion first and let it age in field, or have callers catch and fall back to V0?
| correlationId: UUID, | ||
| clientId: String, | ||
| redirectUri: String, | ||
| scope: String? = null |
There was a problem hiding this comment.
@jvmoverloads on this one too? the deprecated overload has it. java callers wouldn't be able to omit scope otherwise.
AB#3658756