From 9b1c7ad80114118ac09673a50cae17a36f8cf216 Mon Sep 17 00:00:00 2001
From: yuxin <yuxin@microsoft.com>
Date: Thu, 19 Jun 2025 12:52:19 +0100
Subject: [PATCH 1/8] Revert changes on
 PublicClientApplicationConfiguration.java

---
 .../client/PublicClientApplicationConfiguration.java         | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/msal/src/main/java/com/microsoft/identity/client/PublicClientApplicationConfiguration.java b/msal/src/main/java/com/microsoft/identity/client/PublicClientApplicationConfiguration.java
index 79e8a4918..175019293 100644
--- a/msal/src/main/java/com/microsoft/identity/client/PublicClientApplicationConfiguration.java
+++ b/msal/src/main/java/com/microsoft/identity/client/PublicClientApplicationConfiguration.java
@@ -248,9 +248,6 @@ public void setClientId(final String clientId) {
      * @return The List of current Authorities.
      */
     public List<Authority> getAuthorities() {
-        if (mAuthorities == null) {
-            mAuthorities = new ArrayList<>();
-        }
         return mAuthorities;
     }
 
@@ -435,7 +432,7 @@ public Boolean isWebauthnCapable() {
     }
 
     public Authority getDefaultAuthority() {
-        if (mAuthorities != null && mAuthorities.size() != 0) {
+        if (mAuthorities != null) {
             if (mAuthorities.size() > 1) {
                 for (Authority authority : mAuthorities) {
                     if (authority.getDefault()) {

From 7bced751a57962b8aa6ba68a4ef6c3f07fcd2c56 Mon Sep 17 00:00:00 2001
From: yuxin <yuxin@microsoft.com>
Date: Thu, 19 Jun 2025 13:10:21 +0100
Subject: [PATCH 2/8] Add microsoft header

---
 ...NativeAuthChallengeAuthMethodParameters.kt | 23 +++++++++++++++++++
 ...uthVerificationRequiredResultParameters.kt | 23 +++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthChallengeAuthMethodParameters.kt b/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthChallengeAuthMethodParameters.kt
index c8818674b..9c1418d2b 100644
--- a/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthChallengeAuthMethodParameters.kt
+++ b/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthChallengeAuthMethodParameters.kt
@@ -1,3 +1,26 @@
+// 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.nativeauth.parameters
 
 import com.microsoft.identity.nativeauth.AuthMethod
diff --git a/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthRegisterStrongAuthVerificationRequiredResultParameters.kt b/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthRegisterStrongAuthVerificationRequiredResultParameters.kt
index ad4691225..96dad9830 100644
--- a/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthRegisterStrongAuthVerificationRequiredResultParameters.kt
+++ b/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthRegisterStrongAuthVerificationRequiredResultParameters.kt
@@ -1,3 +1,26 @@
+// 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.nativeauth.parameters
 
 import com.microsoft.identity.nativeauth.statemachine.states.RegisterStrongAuthVerificationRequiredState

From b52c05a911701514e34b495a0d53a22d772d4c50 Mon Sep 17 00:00:00 2001
From: yuxin <yuxin@microsoft.com>
Date: Thu, 19 Jun 2025 13:25:58 +0100
Subject: [PATCH 3/8] Native Auth Config Parameters

---
 .../client/PublicClientApplication.java       | 36 ++++++++-----
 ...icClientApplicationConfigurationFactory.kt |  8 ---
 .../parameters/NativeAuthConfigParameters.kt  | 51 +++++++++++++++++++
 ...AuthPublicClientApplicationAbstractTest.kt | 15 +++---
 4 files changed, 80 insertions(+), 30 deletions(-)
 create mode 100644 msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthConfigParameters.kt

diff --git a/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java b/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
index cca160e27..db15b73a7 100644
--- a/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
+++ b/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
@@ -113,7 +113,6 @@
 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.SilentTokenCommandParameters;
-import com.microsoft.identity.common.java.controllers.BaseController;
 import com.microsoft.identity.common.java.controllers.CommandDispatcher;
 import com.microsoft.identity.common.java.controllers.CommandResult;
 import com.microsoft.identity.common.java.controllers.ExceptionAdapter;
@@ -143,6 +142,7 @@
 import com.microsoft.identity.nativeauth.INativeAuthPublicClientApplication;
 import com.microsoft.identity.nativeauth.NativeAuthPublicClientApplication;
 import com.microsoft.identity.nativeauth.NativeAuthPublicClientApplicationConfiguration;
+import com.microsoft.identity.nativeauth.parameters.NativeAuthConfigParameters;
 
 import java.io.File;
 import java.util.ArrayList;
@@ -237,7 +237,7 @@ static class NONNULL_CONSTANTS {
         static final String AUTHORITY = "authority";
         static final String REDIRECT_URI = "redirect_uri";
         static final String CONFIG_FILE = "config_file";
-        static final String CONFIG = "config";
+        static final String CONFIG_PARAMETER = "config_parameter";
         static final String ACTIVITY = "activity";
         static final String SCOPES = "scopes";
         static final String ACCOUNT = "account";
@@ -847,6 +847,7 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
                     null,
                     null,
                     null,
+                    null,
                     null
             );
         }  catch (MsalException e) {
@@ -898,6 +899,7 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
                     null,
                     null,
                     null,
+                    null,
                     null
             );
         } catch (BaseException e) {
@@ -929,6 +931,7 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
      * @param clientId    The application client id. Cannot be null.
      * @param authority   The default authority to be used for the authority. If this is null, the default authority will be used.
      * @param redirectUri The redirect URI of the application.
+     * @param challengeTypes The challengeTypes supported for authentication declared by client.
      * @return An instance of INativeAuthPublicClientApplication.
      *
      * @deprecated This method is deprecated. Use createNativeAuthPublicClientApplication(Context, NativeAuthPublicClientApplicationConfiguration) instead.
@@ -951,7 +954,8 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
                     clientId,
                     authority,
                     redirectUri,
-                    challengeTypes
+                    challengeTypes,
+                    null
             );
         } catch (BaseException e) {
             throw new MsalClientException(
@@ -965,7 +969,7 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
     /**
      * Creates an instance of INativeAuthPublicClientApplication using the provided context and configuration.
      *
-     * <p>{@link PublicClientApplication#createNativeAuthPublicClientApplication(Context, NativeAuthPublicClientApplicationConfiguration)}
+     * <p>{@link PublicClientApplication#createNativeAuthPublicClientApplication(Context, NativeAuthConfigParameters)}
      * will read the client id and other configuration settings from the provided configuration object.</p>
      *
      * <p>This function will pass back an {@link MsalClientException} object if it is unable
@@ -980,7 +984,7 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
      *                strong reference to the activity, thus preventing correct garbage
      *                collection and causing bugs.
      *                </p>
-     * @param config The configuration object containing client ID, authority, redirect URI, and challenge types.
+     * @param nativeAuthConfigParameters The configuration parameter class containing mandatory client ID, challenge types and optional capabilities, authorityUri, redirectUri.
      *               Cannot be null.
      *               <p>
      *               For more information on the schema of the MSAL configuration object,
@@ -991,17 +995,18 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
      */
     public static INativeAuthPublicClientApplication createNativeAuthPublicClientApplication(
             @NonNull final Context context,
-            @NonNull final NativeAuthPublicClientApplicationConfiguration config) throws MsalException {
+            @NonNull final NativeAuthConfigParameters nativeAuthConfigParameters) throws MsalException {
         validateNonNullArgument(context, NONNULL_CONSTANTS.CONTEXT);
-        validateNonNullArgument(config, NONNULL_CONSTANTS.CONFIG);
+        validateNonNullArgument(nativeAuthConfigParameters, NONNULL_CONSTANTS.CONFIG_PARAMETER);
 
         try {
             return createNativeAuthApplication(
-                    Companion.initializeNativeAuthConfiguration(context, config),
-                    null,
-                    null,
-                    null,
-                    null
+                    Companion.initializeNativeAuthConfiguration(context),
+                    nativeAuthConfigParameters.getClientId(),
+                    nativeAuthConfigParameters.getAuthorityUrl(),
+                    nativeAuthConfigParameters.getRedirectUri(),
+                    nativeAuthConfigParameters.getChallengeTypes(),
+                    nativeAuthConfigParameters.getCapabilities()
             );
         } catch (BaseException e) {
             throw new MsalClientException(
@@ -1187,7 +1192,8 @@ private static NativeAuthPublicClientApplication createNativeAuthApplication(@No
                                                                                  @Nullable final String clientId,
                                                                                  @Nullable final String authority,
                                                                                  @Nullable final String redirectUri,
-                                                                                 @Nullable final List<String> challengeTypes) throws BaseException {
+                                                                                 @Nullable final List<String> challengeTypes,
+                                                                                 @Nullable final List<String> capabilities) throws BaseException {
         if (clientId != null) {
             config.setClientId(clientId);
         }
@@ -1208,6 +1214,10 @@ private static NativeAuthPublicClientApplication createNativeAuthApplication(@No
             config.setChallengeTypes(challengeTypes);
         }
 
+        if (capabilities != null) {
+            config.setCapabilities(capabilities);
+        }
+
         // Check whether account mode is set to SINGLE
         validateAccountModeConfiguration(config);
 
diff --git a/msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationConfigurationFactory.kt b/msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationConfigurationFactory.kt
index 1e9ece509..e1b400813 100644
--- a/msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationConfigurationFactory.kt
+++ b/msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationConfigurationFactory.kt
@@ -87,14 +87,6 @@ class NativeAuthPublicClientApplicationConfigurationFactory :
             return initializeNativeAuthConfigurationInternal(context, loadConfiguration(configFile))
         }
 
-        /**
-         * Initialize [NativeAuthPublicClientApplicationConfiguration] object from the provided config object, if there is any,
-         * and merge it with the default native auth config
-         */
-        fun initializeNativeAuthConfiguration(context: Context, config: NativeAuthPublicClientApplicationConfiguration): NativeAuthPublicClientApplicationConfiguration {
-            return initializeNativeAuthConfigurationInternal(context, config)
-        }
-
         /**
          * Initialize the Native Auth configuration with base MSAL default configs and Native Auth default Configs
          */
diff --git a/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthConfigParameters.kt b/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthConfigParameters.kt
new file mode 100644
index 000000000..0b1fa02bb
--- /dev/null
+++ b/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthConfigParameters.kt
@@ -0,0 +1,51 @@
+// 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.nativeauth.parameters
+
+
+class NativeAuthConfigParameters (
+    /**
+     * The application client id. Cannot be null.
+     */
+    val clientId: String,
+    /**
+     * The authorityUrl to be used for the authority.
+     */
+    var authorityUrl: String,
+    /**
+     * The challenge types supported for authentication declared by client. Cannot be null.
+     */
+    val challengeTypes: List<String>,
+) {
+
+    /**
+     * The capabilities supported for authentication declared by client.
+     */
+    var capabilities: List<String>? = null
+
+    /**
+     *  The redirect URI of the application. Required for using browser.
+     */
+    var redirectUri: String? = null
+}
\ No newline at end of file
diff --git a/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt b/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt
index a9c97021a..4a3ca6140 100644
--- a/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt
+++ b/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt
@@ -42,6 +42,7 @@ import com.microsoft.identity.internal.testutils.nativeauth.ConfigType
 import com.microsoft.identity.internal.testutils.nativeauth.api.models.NativeAuthTestConfig
 import com.microsoft.identity.nativeauth.INativeAuthPublicClientApplication
 import com.microsoft.identity.nativeauth.NativeAuthPublicClientApplicationConfiguration
+import com.microsoft.identity.nativeauth.parameters.NativeAuthConfigParameters
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.test.StandardTestDispatcher
 import kotlinx.coroutines.test.setMain
@@ -118,20 +119,16 @@ abstract class NativeAuthPublicClientApplicationAbstractTest : IPublicClientAppl
 
     fun setupPCA(config: NativeAuthTestConfig.Config, challengeTypes: List<String>, capabilities: List<String>): INativeAuthPublicClientApplication {
         return try {
-            val nativeAuthConfig = NativeAuthPublicClientApplicationConfiguration()
-            nativeAuthConfig.clientId = config.clientId
-            val authorityObject = Authority.getAuthorityFromAuthorityUrl(
+            val configParameters = NativeAuthConfigParameters(
+                config.clientId,
                 config.authorityUrl,
-                config.clientId
+                challengeTypes
             )
-            authorityObject.setDefault(true)
-            nativeAuthConfig.getAuthorities().add(authorityObject)
-            nativeAuthConfig.setChallengeTypes(challengeTypes)
-            nativeAuthConfig.setCapabilities(capabilities)
+            configParameters.capabilities = capabilities
 
             PublicClientApplication.createNativeAuthPublicClientApplication(
                 context,
-                nativeAuthConfig
+                configParameters
             )
         } catch (e: MsalException) {
             Assert.fail(e.message)

From 3bc3c2ea45d1e2b7c0a10eecdbe39004d66247e5 Mon Sep 17 00:00:00 2001
From: yuxin <yuxin@microsoft.com>
Date: Thu, 19 Jun 2025 13:29:41 +0100
Subject: [PATCH 4/8] Native Auth Config Parameters

---
 .../identity/client/PublicClientApplication.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java b/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
index db15b73a7..e6bd4b081 100644
--- a/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
+++ b/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
@@ -984,7 +984,7 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
      *                strong reference to the activity, thus preventing correct garbage
      *                collection and causing bugs.
      *                </p>
-     * @param nativeAuthConfigParameters The configuration parameter class containing mandatory client ID, challenge types and optional capabilities, authorityUri, redirectUri.
+     * @param configParameters The configuration parameter class containing mandatory client ID, authorityUri, challenge types and optional capabilities, redirectUri.
      *               Cannot be null.
      *               <p>
      *               For more information on the schema of the MSAL configuration object,
@@ -995,18 +995,18 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
      */
     public static INativeAuthPublicClientApplication createNativeAuthPublicClientApplication(
             @NonNull final Context context,
-            @NonNull final NativeAuthConfigParameters nativeAuthConfigParameters) throws MsalException {
+            @NonNull final NativeAuthConfigParameters configParameters) throws MsalException {
         validateNonNullArgument(context, NONNULL_CONSTANTS.CONTEXT);
-        validateNonNullArgument(nativeAuthConfigParameters, NONNULL_CONSTANTS.CONFIG_PARAMETER);
+        validateNonNullArgument(configParameters, NONNULL_CONSTANTS.CONFIG_PARAMETER);
 
         try {
             return createNativeAuthApplication(
                     Companion.initializeNativeAuthConfiguration(context),
-                    nativeAuthConfigParameters.getClientId(),
-                    nativeAuthConfigParameters.getAuthorityUrl(),
-                    nativeAuthConfigParameters.getRedirectUri(),
-                    nativeAuthConfigParameters.getChallengeTypes(),
-                    nativeAuthConfigParameters.getCapabilities()
+                    configParameters.getClientId(),
+                    configParameters.getAuthorityUrl(),
+                    configParameters.getRedirectUri(),
+                    configParameters.getChallengeTypes(),
+                    configParameters.getCapabilities()
             );
         } catch (BaseException e) {
             throw new MsalClientException(

From c8771bb7d18f7810cc89a2f3886067adf05c91cb Mon Sep 17 00:00:00 2001
From: yuxin <yuxin@microsoft.com>
Date: Thu, 19 Jun 2025 13:35:22 +0100
Subject: [PATCH 5/8] Address copilot comments

---
 .../e2e/tests/network/nativeauth/SignUpEmailPasswordTest.kt   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/SignUpEmailPasswordTest.kt b/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/SignUpEmailPasswordTest.kt
index 53d50ffaa..5115b8c76 100644
--- a/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/SignUpEmailPasswordTest.kt
+++ b/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/SignUpEmailPasswordTest.kt
@@ -155,7 +155,7 @@ class SignUpEmailPasswordTest : NativeAuthPublicClientApplicationAbstractTest()
     @Test
     fun testSuccessOTPResend() {
         config = getConfig(defaultConfigType)
-        application = setupPCA(config, defaultChallengeTypes, defaultChallengeTypes)
+        application = setupPCA(config, defaultChallengeTypes, defaultCapabilities)
 
         retryOperation {
             runBlocking {
@@ -243,7 +243,7 @@ class SignUpEmailPasswordTest : NativeAuthPublicClientApplicationAbstractTest()
     @Test
     fun testErrorInvalidPasswordFormat() {
         config = getConfig(defaultConfigType)
-        application = setupPCA(config, defaultChallengeTypes, defaultChallengeTypes)
+        application = setupPCA(config, defaultChallengeTypes, defaultCapabilities)
 
         runBlocking { // Running with runBlocking to avoid default 10 second execution timeout.
             val user = tempEmailApi.generateRandomEmailAddressLocally()

From 1041c2b319ab0e8e9f359bf4ace94d0b89cd9257 Mon Sep 17 00:00:00 2001
From: yuxin <yuxin@microsoft.com>
Date: Thu, 19 Jun 2025 14:51:44 +0100
Subject: [PATCH 6/8] Address comments

---
 .../client/PublicClientApplication.java       | 20 +++++++++----------
 ...eAuthPublicClientApplicationParameters.kt} |  6 +++---
 ...AuthPublicClientApplicationAbstractTest.kt |  6 ++----
 3 files changed, 15 insertions(+), 17 deletions(-)
 rename msal/src/main/java/com/microsoft/identity/nativeauth/{parameters/NativeAuthConfigParameters.kt => NativeAuthPublicClientApplicationParameters.kt} (93%)

diff --git a/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java b/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
index e6bd4b081..d49a7b550 100644
--- a/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
+++ b/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
@@ -142,7 +142,7 @@
 import com.microsoft.identity.nativeauth.INativeAuthPublicClientApplication;
 import com.microsoft.identity.nativeauth.NativeAuthPublicClientApplication;
 import com.microsoft.identity.nativeauth.NativeAuthPublicClientApplicationConfiguration;
-import com.microsoft.identity.nativeauth.parameters.NativeAuthConfigParameters;
+import com.microsoft.identity.nativeauth.NativeAuthPublicClientApplicationParameters;
 
 import java.io.File;
 import java.util.ArrayList;
@@ -969,7 +969,7 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
     /**
      * Creates an instance of INativeAuthPublicClientApplication using the provided context and configuration.
      *
-     * <p>{@link PublicClientApplication#createNativeAuthPublicClientApplication(Context, NativeAuthConfigParameters)}
+     * <p>{@link PublicClientApplication#createNativeAuthPublicClientApplication(Context, NativeAuthPublicClientApplicationParameters)}
      * will read the client id and other configuration settings from the provided configuration object.</p>
      *
      * <p>This function will pass back an {@link MsalClientException} object if it is unable
@@ -984,7 +984,7 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
      *                strong reference to the activity, thus preventing correct garbage
      *                collection and causing bugs.
      *                </p>
-     * @param configParameters The configuration parameter class containing mandatory client ID, authorityUri, challenge types and optional capabilities, redirectUri.
+     * @param parameters The NativeAuthPublicClientApplication parameter class containing mandatory client ID, authorityUri, challenge types and optional capabilities, redirectUri.
      *               Cannot be null.
      *               <p>
      *               For more information on the schema of the MSAL configuration object,
@@ -995,18 +995,18 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
      */
     public static INativeAuthPublicClientApplication createNativeAuthPublicClientApplication(
             @NonNull final Context context,
-            @NonNull final NativeAuthConfigParameters configParameters) throws MsalException {
+            @NonNull final NativeAuthPublicClientApplicationParameters parameters) throws MsalException {
         validateNonNullArgument(context, NONNULL_CONSTANTS.CONTEXT);
-        validateNonNullArgument(configParameters, NONNULL_CONSTANTS.CONFIG_PARAMETER);
+        validateNonNullArgument(parameters, NONNULL_CONSTANTS.CONFIG_PARAMETER);
 
         try {
             return createNativeAuthApplication(
                     Companion.initializeNativeAuthConfiguration(context),
-                    configParameters.getClientId(),
-                    configParameters.getAuthorityUrl(),
-                    configParameters.getRedirectUri(),
-                    configParameters.getChallengeTypes(),
-                    configParameters.getCapabilities()
+                    parameters.getClientId(),
+                    parameters.getAuthorityUrl(),
+                    parameters.getRedirectUri(),
+                    parameters.getChallengeTypes(),
+                    parameters.getCapabilities()
             );
         } catch (BaseException e) {
             throw new MsalClientException(
diff --git a/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthConfigParameters.kt b/msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationParameters.kt
similarity index 93%
rename from msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthConfigParameters.kt
rename to msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationParameters.kt
index 0b1fa02bb..60be12d25 100644
--- a/msal/src/main/java/com/microsoft/identity/nativeauth/parameters/NativeAuthConfigParameters.kt
+++ b/msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationParameters.kt
@@ -21,10 +21,10 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-package com.microsoft.identity.nativeauth.parameters
+package com.microsoft.identity.nativeauth
 
 
-class NativeAuthConfigParameters (
+public class NativeAuthPublicClientApplicationParameters (
     /**
      * The application client id. Cannot be null.
      */
@@ -32,7 +32,7 @@ class NativeAuthConfigParameters (
     /**
      * The authorityUrl to be used for the authority.
      */
-    var authorityUrl: String,
+    val authorityUrl: String,
     /**
      * The challenge types supported for authentication declared by client. Cannot be null.
      */
diff --git a/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt b/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt
index 4a3ca6140..efdfa7d82 100644
--- a/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt
+++ b/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt
@@ -32,7 +32,6 @@ import com.microsoft.identity.client.e2e.shadows.ShadowAndroidSdkStorageEncrypti
 import com.microsoft.identity.client.e2e.tests.IPublicClientApplicationTest
 import com.microsoft.identity.client.exception.MsalException
 import com.microsoft.identity.common.internal.controllers.CommandDispatcherHelper
-import com.microsoft.identity.common.java.authorities.Authority
 import com.microsoft.identity.internal.testutils.TestUtils
 import com.microsoft.identity.internal.testutils.labutils.KeyVaultFetchHelper
 import com.microsoft.identity.internal.testutils.labutils.LabConstants
@@ -41,8 +40,7 @@ import com.microsoft.identity.internal.testutils.labutils.LabUserQuery
 import com.microsoft.identity.internal.testutils.nativeauth.ConfigType
 import com.microsoft.identity.internal.testutils.nativeauth.api.models.NativeAuthTestConfig
 import com.microsoft.identity.nativeauth.INativeAuthPublicClientApplication
-import com.microsoft.identity.nativeauth.NativeAuthPublicClientApplicationConfiguration
-import com.microsoft.identity.nativeauth.parameters.NativeAuthConfigParameters
+import com.microsoft.identity.nativeauth.NativeAuthPublicClientApplicationParameters
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.test.StandardTestDispatcher
 import kotlinx.coroutines.test.setMain
@@ -119,7 +117,7 @@ abstract class NativeAuthPublicClientApplicationAbstractTest : IPublicClientAppl
 
     fun setupPCA(config: NativeAuthTestConfig.Config, challengeTypes: List<String>, capabilities: List<String>): INativeAuthPublicClientApplication {
         return try {
-            val configParameters = NativeAuthConfigParameters(
+            val configParameters = NativeAuthPublicClientApplicationParameters(
                 config.clientId,
                 config.authorityUrl,
                 challengeTypes

From fa7425e7c04b8b56caa4af524738dfe058604754 Mon Sep 17 00:00:00 2001
From: yuxin <yuxin@microsoft.com>
Date: Thu, 19 Jun 2025 14:54:01 +0100
Subject: [PATCH 7/8] Address comments

---
 .../NativeAuthPublicClientApplicationParameters.kt          | 2 +-
 .../NativeAuthPublicClientApplicationAbstractTest.kt        | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationParameters.kt b/msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationParameters.kt
index 60be12d25..b6a36e1d6 100644
--- a/msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationParameters.kt
+++ b/msal/src/main/java/com/microsoft/identity/nativeauth/NativeAuthPublicClientApplicationParameters.kt
@@ -48,4 +48,4 @@ public class NativeAuthPublicClientApplicationParameters (
      *  The redirect URI of the application. Required for using browser.
      */
     var redirectUri: String? = null
-}
\ No newline at end of file
+}
diff --git a/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt b/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt
index efdfa7d82..63ae2ad80 100644
--- a/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt
+++ b/msal/src/test/java/com/microsoft/identity/client/e2e/tests/network/nativeauth/NativeAuthPublicClientApplicationAbstractTest.kt
@@ -117,16 +117,16 @@ abstract class NativeAuthPublicClientApplicationAbstractTest : IPublicClientAppl
 
     fun setupPCA(config: NativeAuthTestConfig.Config, challengeTypes: List<String>, capabilities: List<String>): INativeAuthPublicClientApplication {
         return try {
-            val configParameters = NativeAuthPublicClientApplicationParameters(
+            val parameters = NativeAuthPublicClientApplicationParameters(
                 config.clientId,
                 config.authorityUrl,
                 challengeTypes
             )
-            configParameters.capabilities = capabilities
+            parameters.capabilities = capabilities
 
             PublicClientApplication.createNativeAuthPublicClientApplication(
                 context,
-                configParameters
+                parameters
             )
         } catch (e: MsalException) {
             Assert.fail(e.message)

From f6760a5ee4fa1aee6752ae512fe24050bfed8d40 Mon Sep 17 00:00:00 2001
From: yuxin <yuxin@microsoft.com>
Date: Thu, 19 Jun 2025 14:55:28 +0100
Subject: [PATCH 8/8] Address comments

---
 .../microsoft/identity/client/PublicClientApplication.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java b/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
index d49a7b550..f0cf2b52d 100644
--- a/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
+++ b/msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java
@@ -237,7 +237,7 @@ static class NONNULL_CONSTANTS {
         static final String AUTHORITY = "authority";
         static final String REDIRECT_URI = "redirect_uri";
         static final String CONFIG_FILE = "config_file";
-        static final String CONFIG_PARAMETER = "config_parameter";
+        static final String CLIENT_PARAMETER = "client_parameter";
         static final String ACTIVITY = "activity";
         static final String SCOPES = "scopes";
         static final String ACCOUNT = "account";
@@ -997,7 +997,7 @@ public static INativeAuthPublicClientApplication createNativeAuthPublicClientApp
             @NonNull final Context context,
             @NonNull final NativeAuthPublicClientApplicationParameters parameters) throws MsalException {
         validateNonNullArgument(context, NONNULL_CONSTANTS.CONTEXT);
-        validateNonNullArgument(parameters, NONNULL_CONSTANTS.CONFIG_PARAMETER);
+        validateNonNullArgument(parameters, NONNULL_CONSTANTS.CLIENT_PARAMETER);
 
         try {
             return createNativeAuthApplication(