Skip to content

Commit 7afe526

Browse files
committed
Add PPE origins to Passkey origin rules for debugging purposes
1 parent 4aaa099 commit 7afe526

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

common/src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyOriginRulesManager.kt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// THE SOFTWARE.
2323
package com.microsoft.identity.common.internal.providers.oauth2
2424

25+
import com.microsoft.identity.common.BuildConfig
2526
import com.microsoft.identity.common.logging.Logger
2627
import java.net.URI
2728

@@ -65,6 +66,13 @@ object PasskeyOriginRulesManager {
6566
"https://login.sovcloud-identity.sg"
6667
)
6768

69+
// PPE origins
70+
private val ALLOWED_ORIGIN_PPE= setOf(
71+
"https://account.live-int.com",
72+
"https://login.windows-ppe.net",
73+
"https://mysignins-ppe.microsoft.com"
74+
)
75+
6876
/**
6977
* Checks if the provided URL is allowed to access Passkey/WebAuthN APIs.
7078
*
@@ -104,7 +112,7 @@ object PasskeyOriginRulesManager {
104112

105113
false
106114
} catch (throwable: Throwable) {
107-
Logger.error(TAG, "Error validating origin for URL: $url.", throwable)
115+
Logger.error(TAG, "Error validating origin for URL.", throwable)
108116
false
109117
}
110118
}
@@ -143,6 +151,10 @@ object PasskeyOriginRulesManager {
143151
* @return Set containing all production and sovereign cloud origin URLs
144152
*/
145153
fun getAllowedOriginRules(): Set<String> {
146-
return PRODUCTION_ORIGINS + SOVEREIGN_CLOUD_ORIGINS
154+
return if (BuildConfig.DEBUG) {
155+
PRODUCTION_ORIGINS + SOVEREIGN_CLOUD_ORIGINS + ALLOWED_ORIGIN_PPE
156+
} else {
157+
PRODUCTION_ORIGINS + SOVEREIGN_CLOUD_ORIGINS
158+
}
147159
}
148160
}

0 commit comments

Comments
 (0)