diff --git a/common/src/main/java/com/microsoft/identity/common/internal/broker/ipc/WebAppsAdditionalRequiredParameters.kt b/common/src/main/java/com/microsoft/identity/common/internal/broker/ipc/WebAppsAdditionalRequiredParameters.kt new file mode 100644 index 0000000000..d83dd24b57 --- /dev/null +++ b/common/src/main/java/com/microsoft/identity/common/internal/broker/ipc/WebAppsAdditionalRequiredParameters.kt @@ -0,0 +1,59 @@ +// 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.internal.broker.ipc + +import com.google.gson.annotations.SerializedName +import com.microsoft.identity.common.java.request.SdkType + +/** + * Additional required parameters for WebApps operations. + */ +data class WebAppsAdditionalRequiredParameters( + // A parameter from Edge which indicates whether the calling application can show UI. + @SerializedName(FIELD_CAN_SHOW_UI) + val canShowUi: Boolean = false, + + @SerializedName(FIELD_CALLING_PACKAGE_NAME) + val callingPackageName: String, + + @SerializedName(FIELD_CALLING_APPLICATION_NAME) + val callingApplicationName: String, + + @SerializedName(FIELD_CALLING_APPLICATION_VERSION) + val callingApplicationVersion: String, + + @SerializedName(FIELD_SDK_TYPE) + val sdkType: SdkType, + + @SerializedName(FIELD_SDK_VERSION) + val sdkVersion: String +) { + companion object { + const val FIELD_CAN_SHOW_UI = "canShowUi" + const val FIELD_CALLING_PACKAGE_NAME = "callingPackageName" + const val FIELD_CALLING_APPLICATION_NAME = "callingApplicationName" + const val FIELD_CALLING_APPLICATION_VERSION = "callingApplicationVersion" + const val FIELD_SDK_TYPE = "sdkType" + const val FIELD_SDK_VERSION = "sdkVersion" + } +} 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 5c44c35786..5c353ef424 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 @@ -65,6 +65,7 @@ import com.microsoft.identity.common.internal.broker.ipc.BoundServiceStrategy; import com.microsoft.identity.common.internal.broker.ipc.BrokerOperationBundle; import com.microsoft.identity.common.internal.broker.ipc.IIpcStrategy; +import com.microsoft.identity.common.internal.broker.ipc.WebAppsAdditionalRequiredParameters; import com.microsoft.identity.common.internal.cache.ActiveBrokerCacheUpdater; import com.microsoft.identity.common.internal.cache.ClientActiveBrokerCache; import com.microsoft.identity.common.internal.cache.HelloCache; @@ -1426,10 +1427,12 @@ public void putValueInSuccessEvent(@NonNull final ApiEndEvent event, * * @param request request string * @param minBrokerProtocolVersion minimum broker protocol version the caller requires. + * @param additionalRequiredParams additional required parameters for web app request. * @throws BaseException */ public String executeWebAppRequest(@NonNull final String request, - @NonNull final String minBrokerProtocolVersion) throws BaseException { + @NonNull final String minBrokerProtocolVersion, + @NonNull final WebAppsAdditionalRequiredParameters additionalRequiredParams) throws BaseException { return getBrokerOperationExecutor().execute(null, new BrokerOperation() { private String negotiatedBrokerProtocolVersion; diff --git a/common4j/src/main/com/microsoft/identity/common/java/exception/ErrorStrings.java b/common4j/src/main/com/microsoft/identity/common/java/exception/ErrorStrings.java index a0d7ab8e94..053f0f9adf 100644 --- a/common4j/src/main/com/microsoft/identity/common/java/exception/ErrorStrings.java +++ b/common4j/src/main/com/microsoft/identity/common/java/exception/ErrorStrings.java @@ -475,6 +475,11 @@ private ErrorStrings() { */ public static final String ALL_WEBAPP_SIGN_OUTS_FAILED = "all_webapp_sign_outs_failed"; + /** + * The requested feature flight is disabled. + */ + public static final String FLIGHT_DISABLED = "flight_disabled"; + /** * A generic error code used when no other error code is applicable. */