AzureAD / microsoft-authentication-library-common-for-android

Common code used by both the Active Directory Authentication Library (ADAL) and the Microsoft Authentication Library (MSAL)
MIT License
41 stars 35 forks source link

[E2E Test] Fix OneAuthTestApp.handleFirstRun #2206

Closed cikelengfeng closed 1 year ago

cikelengfeng commented 1 year ago

The current implementation logic of OneAuthTestApp.handleFirstRun is: switch the config first, then turn on "Prefer AAD Broker" flag. However, OneAuthTestApp decides whether to truly enable the Broker when switching the config. Thus, the current order doesn't activate the Broker as expected.

The solution is to turn on "Prefer AAD Broker" before switching the config.

somalaya commented 1 year ago

Do you mean after switching the toggle "Prefer AAD Broker", OneAuthTestApp does not route the requests through broker in the current order?

cikelengfeng commented 1 year ago

Do you mean after switching the toggle "Prefer AAD Broker", OneAuthTestApp does not route the requests through broker in the current order?

Yes, in my testing, switching app configuration after turning on "Prefer AAD Broker" can truly route requests to broker.

Switching app configuration is the key action which actually take effect according to the "Prefer AAD Broker" flag, so it should be done as last step, I guess there must be some bugs in OneAuthTestApp, but I don't have time to look into their code.

somalaya commented 1 year ago

Do you mean after switching the toggle "Prefer AAD Broker", OneAuthTestApp does not route the requests through broker in the current order?

Yes, in my testing, switching app configuration after turning on "Prefer AAD Broker" can truly route requests to broker.

Switching app configuration is the key action which actually take effect according to the "Prefer AAD Broker" flag, so it should be done as last step, I guess there must be some bugs in OneAuthTestApp, but I don't have time to look into their code.

Sure, we can go with this solution for now. Adding @matthewyu-ms to see if OneAuth team needs to correct this.