Skip to content

Commit f47b86d

Browse files
p3dr0rvCopilot
andauthored
Add constants for broker app link redirect , Fixes AB#3239785 (#2646)
[AB#3239785](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3239785) Currently the Broker uses a custom scheme redirect uri (msauth://Microsoft.AAD.BrokerPlugin). In (AzureAD/ad-accounts-for-android#3098) we introduce app link-based redirect uri for Broker as those are more secure. Here we define the constants for the app link redirect URIs for the Broker apps. --------- Co-authored-by: Copilot <[email protected]>
1 parent 247de93 commit f47b86d

File tree

2 files changed

+58
-11
lines changed

2 files changed

+58
-11
lines changed

common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,41 @@ public static String computeMaxHostBrokerProtocol() {
14831483
*/
14841484
public static final String POWERLIFT_TENANT_ID = "powerLiftTenantId";
14851485

1486+
/**
1487+
* The App Link redirect URL for the Authenticator app.
1488+
*/
1489+
public static final String AUTHENTICATOR_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/authenticator";
1490+
1491+
/**
1492+
* The App Link redirect URL for the LTW app.
1493+
*/
1494+
public static final String LTW_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/ltw";
1495+
1496+
/**
1497+
* App Link redirect URL for the CP app.
1498+
*/
1499+
public static final String COMPANY_PORTAL_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/cp";
1500+
1501+
/**
1502+
* App Link redirect URL for the BrokerHost app.
1503+
*/
1504+
public static final String BROKER_HOST_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/brokerhost";
1505+
1506+
/**
1507+
* App Link redirect URL for the Mock Auth app.
1508+
*/
1509+
public static final String MOCK_LTW_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/mockltw";
1510+
1511+
/**
1512+
* App Link redirect URL for the Mock CP app.
1513+
*/
1514+
public static final String MOCK_CP_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/mockcp";
1515+
1516+
/**
1517+
* App Link redirect URL for the Mock Auth app.
1518+
*/
1519+
public static final String MOCK_AUTH_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/mockauth";
1520+
14861521
/**
14871522
* Bundle identifiers for x-ms-clitelem info.
14881523
*/

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

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ import java.util.Collections
3939
*/
4040
data class BrokerData(val packageName : String,
4141
val signingCertificateThumbprint : String,
42-
private val nickName: String?) {
42+
private val nickName: String?,
43+
val appLinkRedirectUri: String? = null) {
4344
constructor(packageName: String, signingCertificateThumbprint: String):
4445
this(packageName, signingCertificateThumbprint, null)
4546

@@ -94,70 +95,81 @@ data class BrokerData(val packageName : String,
9495
val debugMicrosoftAuthenticator = BrokerData(
9596
AuthenticationConstants.Broker.AZURE_AUTHENTICATOR_APP_PACKAGE_NAME,
9697
AuthenticationConstants.Broker.AZURE_AUTHENTICATOR_APP_DEBUG_SIGNATURE_SHA512,
97-
"debugMicrosoftAuthenticator"
98+
"debugMicrosoftAuthenticator",
99+
AuthenticationConstants.Broker.AUTHENTICATOR_APP_LINK_REDIRECT_URL
98100
)
99101

100102
@JvmStatic
101103
val prodMicrosoftAuthenticator = BrokerData(
102104
AuthenticationConstants.Broker.AZURE_AUTHENTICATOR_APP_PACKAGE_NAME,
103105
AuthenticationConstants.Broker.AZURE_AUTHENTICATOR_APP_RELEASE_SIGNATURE_SHA512,
104-
"prodMicrosoftAuthenticator"
106+
"prodMicrosoftAuthenticator",
107+
AuthenticationConstants.Broker.AUTHENTICATOR_APP_LINK_REDIRECT_URL
105108
)
106109

107110
@JvmStatic
108111
val debugCompanyPortal = BrokerData(
109112
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_PACKAGE_NAME,
110113
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_DEBUG_SIGNATURE_SHA512,
111-
"debugCompanyPortal"
114+
"debugCompanyPortal",
115+
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_LINK_REDIRECT_URL
112116
)
113117

114118
@JvmStatic
115119
val prodCompanyPortal = BrokerData(
116120
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_PACKAGE_NAME,
117121
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_RELEASE_SIGNATURE_SHA512,
118-
"prodCompanyPortal"
122+
"prodCompanyPortal",
123+
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_LINK_REDIRECT_URL
119124
)
120125

121126
@JvmStatic
122127
val debugBrokerHost = BrokerData(
123128
AuthenticationConstants.Broker.BROKER_HOST_APP_PACKAGE_NAME,
124129
AuthenticationConstants.Broker.BROKER_HOST_APP_SIGNATURE_SHA512,
125-
"debugBrokerHost"
130+
"debugBrokerHost",
131+
AuthenticationConstants.Broker.BROKER_HOST_APP_LINK_REDIRECT_URL
126132
)
127133

128134
@JvmStatic
129135
val debugMockCp = BrokerData(
130136
AuthenticationConstants.Broker.MOCK_CP_PACKAGE_NAME,
131137
AuthenticationConstants.Broker.MOCK_CP_SIGNATURE_SHA512,
132-
"debugMockCp"
138+
"debugMockCp",
139+
AuthenticationConstants.Broker.MOCK_CP_APP_LINK_REDIRECT_URL
133140
)
134141

135142
@JvmStatic
136143
val debugMockAuthApp = BrokerData(
137144
AuthenticationConstants.Broker.MOCK_AUTH_APP_PACKAGE_NAME,
138145
AuthenticationConstants.Broker.MOCK_AUTH_APP_SIGNATURE_SHA512,
139-
"debugMockAuthApp"
146+
"debugMockAuthApp",
147+
AuthenticationConstants.Broker.MOCK_AUTH_APP_PACKAGE_NAME
140148
)
141149

142150
@JvmStatic
143151
val debugMockLtw = BrokerData(
144152
AuthenticationConstants.Broker.MOCK_LTW_PACKAGE_NAME,
145153
AuthenticationConstants.Broker.MOCK_LTW_SIGNATURE_SHA512,
146-
"debugMockLtw"
154+
"debugMockLtw",
155+
AuthenticationConstants.Broker.MOCK_LTW_APP_LINK_REDIRECT_URL
147156
)
148157

149158
@JvmStatic
150159
val prodLTW = BrokerData(
151160
AuthenticationConstants.Broker.LTW_APP_PACKAGE_NAME,
152161
AuthenticationConstants.Broker.LTW_APP_SHA512_RELEASE_SIGNATURE,
153-
"prodLTW"
162+
"prodLTW",
163+
AuthenticationConstants.Broker.LTW_APP_LINK_REDIRECT_URL
154164
)
155165

156166
@JvmStatic
157167
val debugLTW = BrokerData(
158168
AuthenticationConstants.Broker.LTW_APP_PACKAGE_NAME,
159169
AuthenticationConstants.Broker.LTW_APP_SHA512_DEBUG_SIGNATURE,
160-
"debugLTW"
170+
"debugLTW",
171+
AuthenticationConstants.Broker.LTW_APP_LINK_REDIRECT_URL
172+
161173
)
162174

163175
@JvmStatic

0 commit comments

Comments
 (0)