From 1ff8a904201a94b8b5575496aaa07a060633351b Mon Sep 17 00:00:00 2001 From: Mohit Date: Mon, 12 May 2025 00:02:23 -0700 Subject: [PATCH 01/10] resource account api --- .../internal/AuthenticationConstants.java | 8 +- .../common/internal/broker/BrokerRequest.java | 3 - .../broker/ipc/BrokerOperationBundle.java | 3 +- .../controllers/BrokerMsalController.java | 57 ++++++++++++ .../request/MsalBrokerRequestAdapter.java | 44 +++++++++ .../result/MsalBrokerResultAdapter.java | 20 ++++ .../controllers/BrokerMsalControllerTest.java | 81 ++++++++++++++++- .../MsalBrokerRequestAdapterTests.java | 63 +++++++++++++ .../request/MsalBrokerResultAdapterTests.kt | 91 +++++++++++++++++++ ...rokerResourceAccountCommandParameters.java | 54 +++++++++++ .../ResourceAccountCommandParameters.java | 43 +++++++++ 11 files changed, 458 insertions(+), 9 deletions(-) create mode 100644 common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerResourceAccountCommandParameters.java create mode 100644 common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java diff --git a/common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java b/common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java index 9c3ba74a8e..dd0a2de4a5 100644 --- a/common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java +++ b/common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java @@ -1610,7 +1610,8 @@ public enum API { BROKER_RESTORE_MSA_ACCOUNTS_WITH_TRANSFER_TOKENS(BROKER_RESTORE_MSA_ACCOUNTS_WITH_TRANSFER_TOKENS_PATH, BROKER_VERSION_5, null), WEBAPPS_GET_SUPPORTED_WEB_APPS_CONTRACTS(WEBAPPS_GET_SUPPORTED_WEB_APPS_CONTRACTS_PATH, null, null), - WEBAPPS_EXECUTE_WEB_APPS_REQUEST(WEBAPPS_EXECUTE_WEB_APPS_REQUEST_PATH, null, null); + WEBAPPS_EXECUTE_WEB_APPS_REQUEST(WEBAPPS_EXECUTE_WEB_APPS_REQUEST_PATH, null, null), + PROVISION_RESOURCE_ACCOUNT(PROVISION_RESOURCE_ACCOUNT_PATH, null, null); // TODO: add broker version /** * The content provider path that the API exists behind. @@ -1789,6 +1790,11 @@ public String getMsalVersion(){ */ public static final String WEBAPPS_EXECUTE_WEB_APPS_REQUEST_PATH = "/webapp/executeWebAppsRequest"; + + public static final String PROVISION_RESOURCE_ACCOUNT_PATH = "/provisionResourceAccount"; + + public static final String GET_AAD_DEVICE_ID_PATH = "/getAadDeviceId"; + /** * BrokerContentProvider URI code constant for MSAL-to-Broker hello request. */ diff --git a/common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerRequest.java b/common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerRequest.java index 976598167a..ed50ce7313 100644 --- a/common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerRequest.java +++ b/common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerRequest.java @@ -94,21 +94,18 @@ private static final class SerializedNames { * Scopes for the request. This is expected to be of the format * "scope 1 scope2 scope3" with space as a delimiter */ - @NonNull @SerializedName(SerializedNames.SCOPE) private String mScope; /** * The redirect uri for the request. */ - @NonNull @SerializedName(SerializedNames.REDIRECT) private String mRedirect; /** * The client id of the application. */ - @NonNull @SerializedName(SerializedNames.CLIENT_ID) private String mClientId; diff --git a/common/src/main/java/com/microsoft/identity/common/internal/broker/ipc/BrokerOperationBundle.java b/common/src/main/java/com/microsoft/identity/common/internal/broker/ipc/BrokerOperationBundle.java index 38ad5fc076..caaf84f42b 100644 --- a/common/src/main/java/com/microsoft/identity/common/internal/broker/ipc/BrokerOperationBundle.java +++ b/common/src/main/java/com/microsoft/identity/common/internal/broker/ipc/BrokerOperationBundle.java @@ -76,7 +76,8 @@ public enum Operation { BROKER_INDIVIDUAL_LOGS_UPLOAD(API.BROKER_INDIVIDUAL_LOGS_UPLOAD, null), BROKER_API_RESTORE_MSA_ACCOUNTS_WITH_TRANSFER_TOKENS(API.BROKER_RESTORE_MSA_ACCOUNTS_WITH_TRANSFER_TOKENS, null), BROKER_WEBAPPS_API_GET_SUPPORTED_WEB_APPS_CONTRACTS(API.WEBAPPS_GET_SUPPORTED_WEB_APPS_CONTRACTS, null), - BROKER_WEBAPPS_API_EXECUTE_WEB_APPS_REQUEST(API.WEBAPPS_EXECUTE_WEB_APPS_REQUEST, null); + BROKER_WEBAPPS_API_EXECUTE_WEB_APPS_REQUEST(API.WEBAPPS_EXECUTE_WEB_APPS_REQUEST, null), + PROVISION_RESOURCE_ACCOUNT(API.PROVISION_RESOURCE_ACCOUNT, null); final API mContentApi; final String mAccountManagerOperation; diff --git a/common/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java b/common/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java index a7839a2b97..7029ad6293 100644 --- a/common/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java +++ b/common/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java @@ -39,6 +39,7 @@ import static com.microsoft.identity.common.internal.broker.ipc.BrokerOperationBundle.Operation.MSAL_REMOVE_ACCOUNT; import static com.microsoft.identity.common.internal.broker.ipc.BrokerOperationBundle.Operation.MSAL_SIGN_OUT_FROM_SHARED_DEVICE; import static com.microsoft.identity.common.internal.broker.ipc.BrokerOperationBundle.Operation.MSAL_SSO_TOKEN; +import static com.microsoft.identity.common.internal.broker.ipc.BrokerOperationBundle.Operation.PROVISION_RESOURCE_ACCOUNT; import static com.microsoft.identity.common.internal.controllers.BrokerOperationExecutor.BrokerOperation; import static com.microsoft.identity.common.java.AuthenticationConstants.LocalBroadcasterAliases.RETURN_BROKER_INTERACTIVE_ACQUIRE_TOKEN_RESULT; import static com.microsoft.identity.common.java.AuthenticationConstants.LocalBroadcasterFields.REQUEST_CODE; @@ -86,6 +87,7 @@ import com.microsoft.identity.common.java.commands.parameters.GenerateShrCommandParameters; import com.microsoft.identity.common.java.commands.parameters.InteractiveTokenCommandParameters; import com.microsoft.identity.common.java.commands.parameters.RemoveAccountCommandParameters; +import com.microsoft.identity.common.java.commands.parameters.ResourceAccountCommandParameters; import com.microsoft.identity.common.java.commands.parameters.RopcTokenCommandParameters; import com.microsoft.identity.common.java.commands.parameters.SilentTokenCommandParameters; import com.microsoft.identity.common.java.commands.parameters.TokenCommandParameters; @@ -1181,7 +1183,62 @@ public void putValueInSuccessEvent(@NonNull final ApiEndEvent event, // TODO Needed? } }); + } + + /** + * Sign in a resource account in broker based on given parameters. Should called by OneAuth/MSAL + * to provision resource account in broker. + * @param parameters a {@link ResourceAccountCommandParameters} + */ + public ICacheRecord provisionResourceAccount(@NonNull final ResourceAccountCommandParameters parameters) throws BaseException { + return getBrokerOperationExecutor().execute(parameters, + new BrokerOperation() { + private String negotiatedBrokerProtocolVersion; + + @Override + public void performPrerequisites(final @NonNull IIpcStrategy strategy) throws BaseException { + negotiatedBrokerProtocolVersion = hello(strategy, parameters.getRequiredBrokerProtocolVersion()); + } + @Override + @NonNull + public BrokerOperationBundle getBundle() { + return new BrokerOperationBundle( + PROVISION_RESOURCE_ACCOUNT, + mActiveBrokerPackageName, + mRequestAdapter.getRequestBundleForProvisionResourceAccount( + parameters, + negotiatedBrokerProtocolVersion + )); + } + + @Override + @NonNull + public ICacheRecord extractResultBundle(final @Nullable Bundle resultBundle) throws BaseException { + if (resultBundle == null) { + throw mResultAdapter.getExceptionForEmptyResultBundle(); + } + verifyBrokerVersionIsSupported(resultBundle, parameters.getRequiredBrokerProtocolVersion()); + return mResultAdapter.resourceAccountRecordFromBundle(resultBundle); + } + + @Override + public @NonNull + String getMethodName() { + return ":provisionResourceAccount"; + } + + @Nullable + @Override + public String getTelemetryApiId() { + return null; + } + + @Override + public void putValueInSuccessEvent(@lombok.NonNull ApiEndEvent event, @lombok.NonNull ICacheRecord result) { + + } + }); } /** diff --git a/common/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java b/common/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java index aa03a76d9d..b19b03f13e 100644 --- a/common/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java +++ b/common/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java @@ -54,6 +54,7 @@ import com.microsoft.identity.common.java.commands.parameters.DeviceCodeFlowCommandParameters; import com.microsoft.identity.common.java.commands.parameters.GenerateShrCommandParameters; import com.microsoft.identity.common.java.commands.parameters.RemoveAccountCommandParameters; +import com.microsoft.identity.common.java.commands.parameters.ResourceAccountCommandParameters; import com.microsoft.identity.common.java.opentelemetry.SerializableSpanContext; import com.microsoft.identity.common.java.opentelemetry.SpanExtension; import com.microsoft.identity.common.java.providers.microsoft.microsoftsts.MicrosoftStsAuthorizationResult; @@ -264,6 +265,49 @@ public Bundle getRequestBundleForAcquireTokenInteractive(@NonNull final Interact ); } + /** + * Method to construct a request bundle for broker provisionResourceAccountRequest request. + * @param parameters input parameters of type {@link ResourceAccountCommandParameters} + * @param negotiatedBrokerProtocolVersion protocol version established by broker hello. + * @return request Bundle + */ + public Bundle getRequestBundleForProvisionResourceAccount( + @NonNull final ResourceAccountCommandParameters parameters, + @Nullable final String negotiatedBrokerProtocolVersion + ) { + final String methodTag = TAG + ":getRequestBundleForProvisionResourceAccount"; + + Logger.info(methodTag, "Constructing result bundle from ProvisionResourceAccount."); + final String extraOptions = parameters.getExtraOptions() != null ? + QueryParamsAdapter._toJson(parameters.getExtraOptions()) : null; + + final BrokerRequest brokerRequest = BrokerRequest.builder() + .authority(parameters.getAuthority().getAuthorityURL().toString()) + .extraOptions(extraOptions) + .homeAccountId(parameters.getHomeAccountId()) + .userName(parameters.getLoginHint()) + .correlationId(parameters.getCorrelationId()) + .clientId(parameters.getClientId()) + .applicationName(parameters.getApplicationName()) + .applicationVersion(parameters.getApplicationVersion()) + .msalVersion(parameters.getSdkVersion()) + .sdkType(parameters.getSdkType()) + .environment(AzureActiveDirectory.getEnvironment().name()) + .powerOptCheckEnabled(parameters.isPowerOptCheckEnabled()) + .spanContext(SerializableSpanContext.builder() + .traceId(SpanExtension.current().getSpanContext().getTraceId()) + .spanId(SpanExtension.current().getSpanContext().getSpanId()) + .traceFlags(SpanExtension.current().getSpanContext().getTraceFlags().asByte()) + .build() + ) + .build(); + return getRequestBundleFromBrokerRequest( + brokerRequest, + negotiatedBrokerProtocolVersion, + parameters.getRequiredBrokerProtocolVersion() + ); + } + /** * Method to construct a request bundle for broker deviceCodeFlowAuthRequest request. * diff --git a/common/src/main/java/com/microsoft/identity/common/internal/result/MsalBrokerResultAdapter.java b/common/src/main/java/com/microsoft/identity/common/internal/result/MsalBrokerResultAdapter.java index 61c705aae8..eed56dc7fa 100644 --- a/common/src/main/java/com/microsoft/identity/common/internal/result/MsalBrokerResultAdapter.java +++ b/common/src/main/java/com/microsoft/identity/common/internal/result/MsalBrokerResultAdapter.java @@ -905,6 +905,26 @@ public List getAccountsFromResultBundle(@NonNull final Bundle bund return JsonExtensions.getICacheRecordListFromJsonString(accountJson); } + /** + * Get resource account record from the result bundle. If successful, new account + * record part of ICachedRecord is returned. + * @param bundle The result bundle from the broker. + * @throws BaseException + */ + public ICacheRecord resourceAccountRecordFromBundle(@NonNull final Bundle bundle) throws BaseException { + final String methodTag = TAG + ":resourceAccountRecordFromBundle"; + final List cacheRecords = getAccountsFromResultBundle(bundle); + if (cacheRecords.isEmpty()) { + Logger.error(methodTag, "No accounts found in the result bundle", null); + throw new ClientException(INVALID_BROKER_BUNDLE, "No accounts found in the result bundle"); + } + if (cacheRecords.size() > 1) { + Logger.error(methodTag, "Multiple accounts found in the result bundle", null); + throw new ClientException(INVALID_BROKER_BUNDLE, "Multiple accounts found in the result bundle"); + } + return cacheRecords.get(0); + } + public void verifyRemoveAccountResultFromBundle(@Nullable final Bundle bundle) throws BaseException { final String methodTag = TAG + ":verifyRemoveAccountResultFromBundle"; if (bundle == null) { diff --git a/common/src/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java b/common/src/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java index 2e347ba5cb..b73a7e5852 100644 --- a/common/src/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java +++ b/common/src/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java @@ -22,23 +22,27 @@ // THE SOFTWARE. package com.microsoft.identity.common.internal.controllers; -import android.content.Context; import android.os.Build; import android.os.Bundle; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.test.platform.app.InstrumentationRegistry; import com.google.gson.Gson; import com.microsoft.identity.common.adal.internal.AuthenticationConstants; import com.microsoft.identity.common.components.MockPlatformComponentsFactory; -import com.microsoft.identity.common.exception.BrokerCommunicationException; import com.microsoft.identity.common.internal.broker.ipc.BrokerOperationBundle; import com.microsoft.identity.common.internal.broker.ipc.IIpcStrategy; +import com.microsoft.identity.common.internal.result.MsalBrokerResultAdapter; +import com.microsoft.identity.common.java.authorities.Authority; +import com.microsoft.identity.common.java.cache.CacheRecord; +import com.microsoft.identity.common.java.cache.ICacheRecord; import com.microsoft.identity.common.java.commands.AcquirePrtSsoTokenResult; import com.microsoft.identity.common.java.commands.parameters.AcquirePrtSsoTokenCommandParameters; +import com.microsoft.identity.common.java.commands.parameters.ResourceAccountCommandParameters; +import com.microsoft.identity.common.java.dto.AccountRecord; import com.microsoft.identity.common.java.interfaces.IPlatformComponents; +import com.microsoft.identity.common.java.request.SdkType; import org.junit.Assert; import org.junit.Test; @@ -47,7 +51,8 @@ import org.robolectric.annotation.Config; import java.util.Collections; -import java.util.List; + +import lombok.SneakyThrows; @RunWith(RobolectricTestRunner.class) @Config(sdk = {Build.VERSION_CODES.N}, shadows = {}) @@ -125,4 +130,72 @@ public Type getType() { Assert.assertEquals("x-ms-RefreshTokenCredential", ssoTokenResult.getCookieName()); } + /** + * This test simulates a result calling the ProvisionResourceAccount Api. + */ + @SneakyThrows + @Test + public void testProvisionResourceAccount() { + final String mockHomeAccountId = "mockHomeAccountId"; + final String mockCorrelationId = "mockCorrelationId"; + final String mockAuthorityStr = "https://login.microsoft.com/mockAuthority"; + final Authority mockAuthority = Authority.getAuthorityFromAuthorityUrl(mockAuthorityStr); + final String mockNegotiatedBrokerVersion = "18.0"; + final String mockAccountName = "mockAccountName"; + final AccountRecord mockAccountRecord = new AccountRecord(); + mockAccountRecord.setHomeAccountId(mockHomeAccountId); + mockAccountRecord.setUsername(mockAccountName); + final CacheRecord mockCacheRecord = CacheRecord.builder() + .account(mockAccountRecord) + .build(); + final MsalBrokerResultAdapter resultAdapter = new MsalBrokerResultAdapter(); + final IIpcStrategy strategy = new IIpcStrategy() { + @Override + public Bundle communicateToBroker(@NonNull BrokerOperationBundle bundle) { + Bundle retBundle = new Bundle(); + if (bundle.getOperation().equals(BrokerOperationBundle.Operation.MSAL_HELLO)) { + retBundle.putString(AuthenticationConstants.Broker.NEGOTIATED_BP_VERSION_KEY, mockNegotiatedBrokerVersion); + } else if (bundle.getOperation().equals(BrokerOperationBundle.Operation.PROVISION_RESOURCE_ACCOUNT)) { + retBundle = resultAdapter.bundleFromAccounts(Collections.singletonList(mockCacheRecord), mockNegotiatedBrokerVersion); + } + return retBundle; + } + + @Override + public boolean isSupportedByTargetedBroker(@NonNull final String targetedBrokerPackageName) { + return true; + } + + @Override + @NonNull + public Type getType() { + return Type.CONTENT_PROVIDER; + } + }; + + final IPlatformComponents components = MockPlatformComponentsFactory.getNonFunctionalBuilder().build(); + final ResourceAccountCommandParameters parameters = ResourceAccountCommandParameters.builder() + .platformComponents(components) + .homeAccountId(mockHomeAccountId) + .authority(mockAuthority) + .correlationId(mockCorrelationId) + .applicationName("mockApplicationName") + .applicationVersion("mockApplicationVersion") + .sdkVersion("mockSdkVersion") + .sdkType(SdkType.MSAL) + .requiredBrokerProtocolVersion(mockNegotiatedBrokerVersion) + .build(); + + final BrokerMsalController controller = new BrokerMsalController( + InstrumentationRegistry.getInstrumentation().getContext(), + components, + "aBrokerPackage", + Collections.singletonList(strategy)); + + final ICacheRecord cacheRecord = controller.provisionResourceAccount(parameters); + + // verify the cache record + Assert.assertEquals(mockHomeAccountId, cacheRecord.getAccount().getHomeAccountId()); + Assert.assertEquals(mockAccountName, cacheRecord.getAccount().getUsername()); + } } diff --git a/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java b/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java index 6658e9b886..ba235d5330 100644 --- a/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java +++ b/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java @@ -23,39 +23,57 @@ package com.microsoft.identity.common.internal.request; import static com.microsoft.identity.common.adal.internal.AuthenticationConstants.Broker.ACCOUNT_CORRELATIONID; +import static com.microsoft.identity.common.adal.internal.AuthenticationConstants.Broker.BROKER_REQUEST_V2_COMPRESSED; import static com.microsoft.identity.common.adal.internal.AuthenticationConstants.Broker.REQUEST_AUTHORITY; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import android.os.Bundle; +import androidx.annotation.NonNull; import androidx.test.core.app.ApplicationProvider; +import androidx.test.platform.app.InstrumentationRegistry; import com.microsoft.identity.common.adal.internal.AuthenticationConstants; import com.microsoft.identity.common.components.MockPlatformComponentsFactory; import com.microsoft.identity.common.internal.broker.BrokerRequest; +import com.microsoft.identity.common.internal.broker.ipc.BrokerOperationBundle; +import com.microsoft.identity.common.internal.broker.ipc.IIpcStrategy; import com.microsoft.identity.common.internal.commands.parameters.AndroidInteractiveTokenCommandParameters; +import com.microsoft.identity.common.internal.controllers.BrokerMsalController; import com.microsoft.identity.common.internal.msafederation.google.SignInWithGoogleCredential; import com.microsoft.identity.common.internal.msafederation.google.SignInWithGoogleParameters; +import com.microsoft.identity.common.internal.result.MsalBrokerResultAdapter; +import com.microsoft.identity.common.internal.util.GzipUtil; +import com.microsoft.identity.common.java.authorities.Authority; import com.microsoft.identity.common.java.authorities.AzureActiveDirectoryAuthority; import com.microsoft.identity.common.java.authorities.AzureActiveDirectoryB2CAuthority; import com.microsoft.identity.common.java.authscheme.BearerAuthenticationSchemeInternal; +import com.microsoft.identity.common.java.cache.CacheRecord; +import com.microsoft.identity.common.java.cache.ICacheRecord; import com.microsoft.identity.common.java.commands.parameters.AcquirePrtSsoTokenCommandParameters; import com.microsoft.identity.common.java.commands.parameters.InteractiveTokenCommandParameters; +import com.microsoft.identity.common.java.commands.parameters.ResourceAccountCommandParameters; +import com.microsoft.identity.common.java.dto.AccountRecord; import com.microsoft.identity.common.java.interfaces.IPlatformComponents; import com.microsoft.identity.common.java.providers.oauth2.OpenIdConnectPromptParameter; import com.microsoft.identity.common.java.request.SdkType; import com.microsoft.identity.common.java.ui.BrowserDescriptor; import com.microsoft.identity.common.java.util.StringUtil; +import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; +import java.util.Collections; import java.util.HashSet; import java.util.Set; +import lombok.SneakyThrows; + @RunWith(RobolectricTestRunner.class) public class MsalBrokerRequestAdapterTests { @@ -226,6 +244,51 @@ public void test_BrokerRequestFromAcquireTokenParameters_SignInWithGoogleParamet assertEquals(signInWithGoogleCredential, brokerRequest.getSignInWithGoogleCredential()); } + @Test + @SneakyThrows + public void testGetRequestBundleForProvisionResourceAccount() { + final String mockHomeAccountId = "mockHomeAccountId"; + final String mockCorrelationId = "mockCorrelationId"; + final String mockAuthorityStr = "https://login.microsoft.com/mockAuthority"; + final Authority mockAuthority = Authority.getAuthorityFromAuthorityUrl(mockAuthorityStr); + final String mockNegotiatedBrokerVersion = "18.0"; + final String mockApplicationName = "mockApplicationName"; + final String mockApplicationVersion = "mockApplicationVersion"; + final String mockSdkVersion = "mockSdkVersion"; + + final IPlatformComponents components = MockPlatformComponentsFactory.getNonFunctionalBuilder().build(); + final ResourceAccountCommandParameters parameters = ResourceAccountCommandParameters.builder() + .platformComponents(components) + .homeAccountId(mockHomeAccountId) + .authority(mockAuthority) + .correlationId(mockCorrelationId) + .applicationName(mockApplicationName) + .applicationVersion(mockApplicationVersion) + .sdkVersion(mockSdkVersion) + .sdkType(SdkType.MSAL) + .requiredBrokerProtocolVersion(mockNegotiatedBrokerVersion) + .build(); + + final MsalBrokerRequestAdapter requestAdapter = new MsalBrokerRequestAdapter(); + final Bundle bundle = requestAdapter.getRequestBundleForProvisionResourceAccount(parameters, mockNegotiatedBrokerVersion); + + assertTrue(bundle.containsKey(BROKER_REQUEST_V2_COMPRESSED)); + final String deCompressedString = GzipUtil.decompressBytesToString( + bundle.getByteArray(BROKER_REQUEST_V2_COMPRESSED) + ); + final BrokerRequest brokerRequest = AuthenticationSchemeTypeAdapter.getGsonInstance().fromJson( + deCompressedString, BrokerRequest.class + ); + assertEquals(mockHomeAccountId, brokerRequest.getHomeAccountId()); + assertNull(brokerRequest.getUserName()); + assertEquals(mockAuthorityStr, brokerRequest.getAuthority()); + assertEquals(mockCorrelationId, brokerRequest.getCorrelationId()); + assertEquals(mockApplicationName, brokerRequest.getApplicationName()); + assertEquals(mockApplicationVersion, brokerRequest.getApplicationVersion()); + assertEquals(SdkType.MSAL, brokerRequest.getSdkType()); + assertEquals(mockSdkVersion, brokerRequest.getMsalVersion()); + } + private void test_BrokerRequestFromAcquireTokenParametersInternal(final boolean suppressBrokerAccountPicker) { final Set scopes = new HashSet<>(); scopes.add("user.read"); diff --git a/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerResultAdapterTests.kt b/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerResultAdapterTests.kt index bed26412cf..1f89ad11f3 100644 --- a/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerResultAdapterTests.kt +++ b/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerResultAdapterTests.kt @@ -26,10 +26,14 @@ import com.microsoft.identity.common.internal.result.MsalBrokerResultAdapter import com.microsoft.identity.common.internal.result.MsalBrokerResultAdapter.REMOVE_RT_FROM_AAD_RESULT_MSAL_PROTOCOL_VERSION import com.microsoft.identity.common.java.cache.CacheRecord import com.microsoft.identity.common.java.cache.ICacheRecord +import com.microsoft.identity.common.java.dto.AccountRecord +import com.microsoft.identity.common.java.exception.ClientException import com.microsoft.identity.common.java.request.SdkType import com.microsoft.identity.common.java.result.LocalAuthenticationResult import com.microsoft.identity.internal.testutils.MockRecords +import lombok.SneakyThrows import org.junit.Assert +import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner @@ -197,4 +201,91 @@ class MsalBrokerResultAdapterTests { Assert.assertNull(tenantProfile.refreshToken) } } + + /** + * Tests result for [MsalBrokerResultAdapter.resourceAccountRecordFromBundle] + */ + @Test + @SneakyThrows + fun testResourceAccountRecordFromBundle() { + val mockHomeAccountId = "mockHomeAccountId" + val mockNegotiatedBrokerVersion = "18.0" + val mockAccountName = "mockAccountName" + val mockAccountRecord = AccountRecord() + mockAccountRecord.homeAccountId = mockHomeAccountId + mockAccountRecord.username = mockAccountName + val mockCacheRecord = CacheRecord.builder() + .account(mockAccountRecord) + .build() + val resultAdapter = MsalBrokerResultAdapter() + + val resultBundle = resultAdapter.bundleFromAccounts( + listOf(mockCacheRecord), + mockNegotiatedBrokerVersion + ) + + val resultCacheRecord = resultAdapter.resourceAccountRecordFromBundle(resultBundle) + + assertEquals(mockHomeAccountId, resultCacheRecord.account.homeAccountId) + assertEquals(mockAccountName, resultCacheRecord.account.username) + } + + /** + * Tests result for [MsalBrokerResultAdapter.resourceAccountRecordFromBundle] + */ + @Test + @SneakyThrows + fun testResourceAccountRecordFromBundle_NoAccountReturned() { + val mockHomeAccountId = "mockHomeAccountId" + val mockNegotiatedBrokerVersion = "18.0" + val mockAccountName = "mockAccountName" + val mockAccountRecord = AccountRecord() + mockAccountRecord.homeAccountId = mockHomeAccountId + mockAccountRecord.username = mockAccountName + val resultAdapter = MsalBrokerResultAdapter() + + val resultBundle = resultAdapter.bundleFromAccounts( + emptyList(), + mockNegotiatedBrokerVersion + ) + + try { + resultAdapter.resourceAccountRecordFromBundle(resultBundle) + Assert.fail("Expected exception not thrown") + } catch (e: ClientException) { + // Expected exception + assertEquals(ClientException.INVALID_BROKER_BUNDLE, e.errorCode) + } + } + + /** + * Tests result for [MsalBrokerResultAdapter.resourceAccountRecordFromBundle] + */ + @Test + @SneakyThrows + fun testResourceAccountRecordFromBundle_MoreThanOneAccount() { + val mockHomeAccountId = "mockHomeAccountId" + val mockNegotiatedBrokerVersion = "18.0" + val mockAccountName = "mockAccountName" + val mockAccountRecord = AccountRecord() + mockAccountRecord.homeAccountId = mockHomeAccountId + mockAccountRecord.username = mockAccountName + val mockCacheRecord = CacheRecord.builder() + .account(mockAccountRecord) + .build() + val resultAdapter = MsalBrokerResultAdapter() + + val resultBundle = resultAdapter.bundleFromAccounts( + listOf(mockCacheRecord, mockCacheRecord), + mockNegotiatedBrokerVersion + ) + + try { + resultAdapter.resourceAccountRecordFromBundle(resultBundle) + Assert.fail("Expected exception not thrown") + } catch (e: ClientException) { + // Expected exception + assertEquals(ClientException.INVALID_BROKER_BUNDLE, e.errorCode) + } + } } \ No newline at end of file diff --git a/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerResourceAccountCommandParameters.java b/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerResourceAccountCommandParameters.java new file mode 100644 index 0000000000..c8c581840b --- /dev/null +++ b/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerResourceAccountCommandParameters.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.common.java.commands.parameters; + +import com.google.gson.annotations.Expose; +import com.microsoft.identity.common.java.broker.IBrokerAccount; +import com.microsoft.identity.common.java.request.BrokerRequestType; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.experimental.SuperBuilder; + +/** + * Command parameters used by the broker internally while executing + * provision resource account request. + */ +@Getter +@SuperBuilder(toBuilder = true) +@EqualsAndHashCode(callSuper = true) +public class BrokerResourceAccountCommandParameters extends ResourceAccountCommandParameters { + @Expose + private final int callerUid; + + @Expose + private final String callerAppVersion; + + @Expose + private final String brokerVersion; + + private final IBrokerAccount brokerAccount; + + @Expose + private final BrokerRequestType requestType; +} diff --git a/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java b/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java new file mode 100644 index 0000000000..e91336fc68 --- /dev/null +++ b/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package com.microsoft.identity.common.java.commands.parameters; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NonNull; +import lombok.experimental.SuperBuilder; + +/** + * Command parameters for setting up Resource Account in broker. This object is part of API. + * The caller constructs this and pass to BrokerMSALlController. + */ +@Getter +@SuperBuilder(toBuilder = true) +@EqualsAndHashCode(callSuper = true) +public class ResourceAccountCommandParameters extends TokenCommandParameters { + + // user id in home tenant uid.tid + @NonNull + private final String homeAccountId; +} From e9c224654a335920eb40c0bbc98a97ee1717821b Mon Sep 17 00:00:00 2001 From: Mohit Date: Mon, 12 May 2025 00:07:48 -0700 Subject: [PATCH 02/10] changelog --- changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.txt b/changelog.txt index 77c4c4f5ca..7e6b89122a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,6 @@ vNext ---------- +- [MINOR] Add API for resource account provisioning (API only) - [PATCH] Allow generating wrapping key without PURPOSE_WRAP_KEY with Flight (#2633)) - [MINOR] Adding a state parameter to prevent phish attacks, in “switch_browser” flow. (#2631) - [MINOR] Move camera logic to CameraPermissionRequestHandler and add SdmQrPinManager (#2630) From aeca3f7fb547f6854e85b859c0102d8f3a1bf057 Mon Sep 17 00:00:00 2001 From: Mohit Date: Mon, 12 May 2025 00:09:28 -0700 Subject: [PATCH 03/10] PR# --- changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 7e6b89122a..46b4a75edb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,6 @@ vNext ---------- -- [MINOR] Add API for resource account provisioning (API only) +- [MINOR] Add API for resource account provisioning (API only) (#2640) - [PATCH] Allow generating wrapping key without PURPOSE_WRAP_KEY with Flight (#2633)) - [MINOR] Adding a state parameter to prevent phish attacks, in “switch_browser” flow. (#2631) - [MINOR] Move camera logic to CameraPermissionRequestHandler and add SdmQrPinManager (#2630) From eab13af41afb0f396f9329a42cbb9ce46339c075 Mon Sep 17 00:00:00 2001 From: Mohit Date: Mon, 12 May 2025 09:02:06 -0700 Subject: [PATCH 04/10] fix UT --- .../common/internal/request/MsalBrokerRequestAdapterTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java b/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java index ba235d5330..f4cac49f38 100644 --- a/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java +++ b/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java @@ -249,7 +249,7 @@ public void test_BrokerRequestFromAcquireTokenParameters_SignInWithGoogleParamet public void testGetRequestBundleForProvisionResourceAccount() { final String mockHomeAccountId = "mockHomeAccountId"; final String mockCorrelationId = "mockCorrelationId"; - final String mockAuthorityStr = "https://login.microsoft.com/mockAuthority"; + final String mockAuthorityStr = "https://login.microsoftonline.com/mockAuthority"; final Authority mockAuthority = Authority.getAuthorityFromAuthorityUrl(mockAuthorityStr); final String mockNegotiatedBrokerVersion = "18.0"; final String mockApplicationName = "mockApplicationName"; From 3e0f7a251de8b58a35997eb61e5b3b21fc12ac6e Mon Sep 17 00:00:00 2001 From: Mohit Date: Tue, 13 May 2025 12:15:27 -0700 Subject: [PATCH 05/10] fix typo --- .../commands/parameters/ResourceAccountCommandParameters.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java b/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java index e91336fc68..c0667cd4a9 100644 --- a/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java +++ b/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java @@ -30,7 +30,7 @@ /** * Command parameters for setting up Resource Account in broker. This object is part of API. - * The caller constructs this and pass to BrokerMSALlController. + * The caller constructs this and pass to BrokerMSALController. */ @Getter @SuperBuilder(toBuilder = true) From f3288b811f32debe3bf9d57896ea51dcc3f7b751 Mon Sep 17 00:00:00 2001 From: Mohit Date: Wed, 14 May 2025 09:50:30 -0700 Subject: [PATCH 06/10] make client id and redirect nonnull --- .../identity/common/internal/broker/BrokerRequest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerRequest.java b/common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerRequest.java index ed50ce7313..060d22874f 100644 --- a/common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerRequest.java +++ b/common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerRequest.java @@ -100,12 +100,14 @@ private static final class SerializedNames { /** * The redirect uri for the request. */ + @NonNull @SerializedName(SerializedNames.REDIRECT) private String mRedirect; /** * The client id of the application. */ + @NonNull @SerializedName(SerializedNames.CLIENT_ID) private String mClientId; From f8e895663f0a04fb2e8a6c1da086cf8f08257cb5 Mon Sep 17 00:00:00 2001 From: Mohit Date: Wed, 14 May 2025 22:25:31 -0700 Subject: [PATCH 07/10] fix UTs --- .../common/internal/request/MsalBrokerRequestAdapter.java | 1 + .../internal/controllers/BrokerMsalControllerTest.java | 4 ++++ .../internal/request/MsalBrokerRequestAdapterTests.java | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java b/common/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java index b19b03f13e..89bd093d15 100644 --- a/common/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java +++ b/common/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java @@ -288,6 +288,7 @@ public Bundle getRequestBundleForProvisionResourceAccount( .userName(parameters.getLoginHint()) .correlationId(parameters.getCorrelationId()) .clientId(parameters.getClientId()) + .redirect(parameters.getRedirectUri()) .applicationName(parameters.getApplicationName()) .applicationVersion(parameters.getApplicationVersion()) .msalVersion(parameters.getSdkVersion()) diff --git a/common/src/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java b/common/src/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java index b73a7e5852..872a301d57 100644 --- a/common/src/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java +++ b/common/src/test/java/com/microsoft/identity/common/internal/controllers/BrokerMsalControllerTest.java @@ -142,6 +142,8 @@ public void testProvisionResourceAccount() { final Authority mockAuthority = Authority.getAuthorityFromAuthorityUrl(mockAuthorityStr); final String mockNegotiatedBrokerVersion = "18.0"; final String mockAccountName = "mockAccountName"; + final String mockClientId = "mockClientId"; + final String mockRedirectUri = "mockRedirectUri"; final AccountRecord mockAccountRecord = new AccountRecord(); mockAccountRecord.setHomeAccountId(mockHomeAccountId); mockAccountRecord.setUsername(mockAccountName); @@ -183,6 +185,8 @@ public Type getType() { .applicationVersion("mockApplicationVersion") .sdkVersion("mockSdkVersion") .sdkType(SdkType.MSAL) + .clientId(mockClientId) + .redirectUri(mockRedirectUri) .requiredBrokerProtocolVersion(mockNegotiatedBrokerVersion) .build(); diff --git a/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java b/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java index f4cac49f38..a11a7da382 100644 --- a/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java +++ b/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java @@ -255,7 +255,8 @@ public void testGetRequestBundleForProvisionResourceAccount() { final String mockApplicationName = "mockApplicationName"; final String mockApplicationVersion = "mockApplicationVersion"; final String mockSdkVersion = "mockSdkVersion"; - + final String mockClientId = "mockClientId"; + final String mockRedirectUri = "mockRedirectUri"; final IPlatformComponents components = MockPlatformComponentsFactory.getNonFunctionalBuilder().build(); final ResourceAccountCommandParameters parameters = ResourceAccountCommandParameters.builder() .platformComponents(components) @@ -266,6 +267,8 @@ public void testGetRequestBundleForProvisionResourceAccount() { .applicationVersion(mockApplicationVersion) .sdkVersion(mockSdkVersion) .sdkType(SdkType.MSAL) + .clientId(mockClientId) + .redirectUri(mockRedirectUri) .requiredBrokerProtocolVersion(mockNegotiatedBrokerVersion) .build(); From 1ff5104b55f0b3cac1bf48d67ed6eab00e74ba7d Mon Sep 17 00:00:00 2001 From: Mohit Date: Wed, 14 May 2025 22:45:39 -0700 Subject: [PATCH 08/10] fix Ut --- .../common/internal/request/MsalBrokerRequestAdapterTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java b/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java index a11a7da382..47943b8ba3 100644 --- a/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java +++ b/common/src/test/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapterTests.java @@ -290,6 +290,8 @@ public void testGetRequestBundleForProvisionResourceAccount() { assertEquals(mockApplicationVersion, brokerRequest.getApplicationVersion()); assertEquals(SdkType.MSAL, brokerRequest.getSdkType()); assertEquals(mockSdkVersion, brokerRequest.getMsalVersion()); + assertEquals(mockClientId, brokerRequest.getClientId()); + assertEquals(mockRedirectUri, brokerRequest.getRedirect()); } private void test_BrokerRequestFromAcquireTokenParametersInternal(final boolean suppressBrokerAccountPicker) { From bfa7356220798a3f9bfcadd8bdfd12b79c73cd86 Mon Sep 17 00:00:00 2001 From: Mohit Date: Fri, 16 May 2025 13:17:42 -0700 Subject: [PATCH 09/10] address comment --- .../identity/common/adal/internal/AuthenticationConstants.java | 2 +- .../parameters/BrokerResourceAccountCommandParameters.java | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java b/common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java index 4c8a3b4ecb..c0f95d8655 100644 --- a/common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java +++ b/common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java @@ -1627,7 +1627,7 @@ public enum API { WEBAPPS_GET_SUPPORTED_WEB_APPS_CONTRACTS(WEBAPPS_GET_SUPPORTED_WEB_APPS_CONTRACTS_PATH, null, null), WEBAPPS_EXECUTE_WEB_APPS_REQUEST(WEBAPPS_EXECUTE_WEB_APPS_REQUEST_PATH, null, null), - PROVISION_RESOURCE_ACCOUNT(PROVISION_RESOURCE_ACCOUNT_PATH, null, null); // TODO: add broker version + PROVISION_RESOURCE_ACCOUNT(PROVISION_RESOURCE_ACCOUNT_PATH, null, null); /** * The content provider path that the API exists behind. diff --git a/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerResourceAccountCommandParameters.java b/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerResourceAccountCommandParameters.java index c8c581840b..ff35573247 100644 --- a/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerResourceAccountCommandParameters.java +++ b/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerResourceAccountCommandParameters.java @@ -48,7 +48,4 @@ public class BrokerResourceAccountCommandParameters extends ResourceAccountComma private final String brokerVersion; private final IBrokerAccount brokerAccount; - - @Expose - private final BrokerRequestType requestType; } From cd05fc06a9098e56a57e833e7e09941afc17cc44 Mon Sep 17 00:00:00 2001 From: Mohit Date: Mon, 19 May 2025 15:27:01 -0700 Subject: [PATCH 10/10] fix typo --- .../commands/parameters/ResourceAccountCommandParameters.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java b/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java index c0667cd4a9..9605c98bb9 100644 --- a/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java +++ b/common4j/src/main/com/microsoft/identity/common/java/commands/parameters/ResourceAccountCommandParameters.java @@ -30,7 +30,7 @@ /** * Command parameters for setting up Resource Account in broker. This object is part of API. - * The caller constructs this and pass to BrokerMSALController. + * The caller constructs this and pass to BrokerMsalController. */ @Getter @SuperBuilder(toBuilder = true)