Skip to content

Commit 2b09787

Browse files
authored
Allow apps to setShouldTrustDebugBrokers, Fixes AB#3533160 (#2932)
Revert [#2900](#2900) [AB#3533160](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3533160) Reason: We removed an ability for apps [to trust debug brokers](#2900) last month because LTW were enforcing this to "NOT Trust debug broker" (meaning all of our tests involving LTW and brokerhost would fail) and they were on holiday. As a side effect, this means OneAuthTestApp cannot test with BrokerHost either. (OneAuthTestApp needs to "pretend" to be Outlook,Word,etc, so they cannot test with prod broker.) The Fix: Revert this change = OneAuth apps can select to trust debug broker apps. (and I already reached out to LTW to undo the blocking code on their side).
1 parent 4b7dfb5 commit 2b09787

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

  • common/src/main/java/com/microsoft/identity/common/internal/broker

common/src/main/java/com/microsoft/identity/common/internal/broker/BrokerData.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,10 @@ data class BrokerData(
8989
@JvmStatic
9090
fun setShouldTrustDebugBrokers(value: Boolean) {
9191
val methodTag = "$TAG:setShouldTrustDebugBrokers"
92-
if (BuildConfig.DEBUG) {
93-
sShouldTrustDebugBrokers = value
94-
Logger.info(methodTag, "Setting shouldTrustDebugBrokers to $value." +
95-
" This should only be used for testing purposes.")
96-
} else {
97-
Logger.warn(methodTag, "Attempting to set shouldTrustDebugBrokers to $value. " +
98-
"This change will be ignored since the current build is not a debug build.")
92+
if (!BuildConfig.DEBUG && value) {
93+
Logger.warn(methodTag, "You are forcing to trust debug brokers in non-debug builds.")
9994
}
95+
sShouldTrustDebugBrokers = value
10096
}
10197

10298
@JvmStatic

0 commit comments

Comments
 (0)