Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Version 21.3.0
- [MINOR] Fixing the sign in screens when edge to edge is enabled (#2665)
- [MINOR] Native auth: Make native auth MFA feature more backward compatible(#2669)
- [MINOR] Showing webcp flow in webview (#2673)
- [MINOR] Construct broker app link redirect based on broker pkg name (#2682)

Version 21.2.0
----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1494,39 +1494,19 @@ public static String computeMaxHostBrokerProtocol() {
public static final String POWERLIFT_TENANT_ID = "powerLiftTenantId";

/**
* The App Link redirect URL for the Authenticator app.
* The scheme for the app link redirect URI used by the broker.
*/
public static final String AUTHENTICATOR_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/authenticator";
public static final String BROKER_APP_LINK_REDIRECT_URL_SCHEME = "https";

/**
* The App Link redirect URL for the LTW app.
* The host for the app link redirect URIs used by the broker.
*/
public static final String LTW_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/ltw";
public static final String BROKER_APP_LINK_REDIRECT_URL_HOST = "login.microsoftonline.com";

/**
* App Link redirect URL for the CP app.
* The path prefix for the app link redirect URIs used by the broker.
*/
public static final String COMPANY_PORTAL_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/cp";

/**
* App Link redirect URL for the BrokerHost app.
*/
public static final String BROKER_HOST_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/brokerhost";

/**
* App Link redirect URL for the Mock Auth app.
*/
public static final String MOCK_LTW_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/mockltw";

/**
* App Link redirect URL for the Mock CP app.
*/
public static final String MOCK_CP_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/mockcp";

/**
* App Link redirect URL for the Mock Auth app.
*/
public static final String MOCK_AUTH_APP_LINK_REDIRECT_URL = "https://login.microsoftonline.com/mockauth";
public static final String BROKER_APP_LINK_REDIRECT_URL_PATH_PREFIX = "androidbroker";

/**
* Bundle identifiers for x-ms-clitelem info.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ import java.util.Collections
*/
data class BrokerData(val packageName : String,
val signingCertificateThumbprint : String,
private val nickName: String?,
val appLinkRedirectUri: String? = null) {
private val nickName: String?) {
constructor(packageName: String, signingCertificateThumbprint: String):
this(packageName, signingCertificateThumbprint, null)

Expand Down Expand Up @@ -68,6 +67,13 @@ data class BrokerData(val packageName : String,
return "$packageName::$signingCertificateThumbprint"
}

fun getAppLinkRedirectUri(): String {
Copy link

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a URI builder or equivalent mechanism to handle URL encoding for the packageName to ensure the generated URI is valid in all cases.

Copilot uses AI. Check for mistakes.
val scheme = AuthenticationConstants.Broker.BROKER_APP_LINK_REDIRECT_URL_SCHEME
val host = AuthenticationConstants.Broker.BROKER_APP_LINK_REDIRECT_URL_HOST
val pathPrefix = AuthenticationConstants.Broker.BROKER_APP_LINK_REDIRECT_URL_PATH_PREFIX
return "$scheme://$host/$pathPrefix/$packageName"
}

companion object {
val TAG = BrokerData::class.simpleName

Expand Down Expand Up @@ -95,80 +101,70 @@ data class BrokerData(val packageName : String,
val debugMicrosoftAuthenticator = BrokerData(
AuthenticationConstants.Broker.AZURE_AUTHENTICATOR_APP_PACKAGE_NAME,
AuthenticationConstants.Broker.AZURE_AUTHENTICATOR_APP_DEBUG_SIGNATURE_SHA512,
"debugMicrosoftAuthenticator",
AuthenticationConstants.Broker.AUTHENTICATOR_APP_LINK_REDIRECT_URL
"debugMicrosoftAuthenticator"
)

@JvmStatic
val prodMicrosoftAuthenticator = BrokerData(
AuthenticationConstants.Broker.AZURE_AUTHENTICATOR_APP_PACKAGE_NAME,
AuthenticationConstants.Broker.AZURE_AUTHENTICATOR_APP_RELEASE_SIGNATURE_SHA512,
"prodMicrosoftAuthenticator",
AuthenticationConstants.Broker.AUTHENTICATOR_APP_LINK_REDIRECT_URL
"prodMicrosoftAuthenticator"
)

@JvmStatic
val debugCompanyPortal = BrokerData(
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_PACKAGE_NAME,
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_DEBUG_SIGNATURE_SHA512,
"debugCompanyPortal",
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_LINK_REDIRECT_URL
"debugCompanyPortal"
)

@JvmStatic
val prodCompanyPortal = BrokerData(
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_PACKAGE_NAME,
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_RELEASE_SIGNATURE_SHA512,
"prodCompanyPortal",
AuthenticationConstants.Broker.COMPANY_PORTAL_APP_LINK_REDIRECT_URL
"prodCompanyPortal"
)

@JvmStatic
val debugBrokerHost = BrokerData(
AuthenticationConstants.Broker.BROKER_HOST_APP_PACKAGE_NAME,
AuthenticationConstants.Broker.BROKER_HOST_APP_SIGNATURE_SHA512,
"debugBrokerHost",
AuthenticationConstants.Broker.BROKER_HOST_APP_LINK_REDIRECT_URL
"debugBrokerHost"
)

@JvmStatic
val debugMockCp = BrokerData(
AuthenticationConstants.Broker.MOCK_CP_PACKAGE_NAME,
AuthenticationConstants.Broker.MOCK_CP_SIGNATURE_SHA512,
"debugMockCp",
AuthenticationConstants.Broker.MOCK_CP_APP_LINK_REDIRECT_URL
"debugMockCp"
)

@JvmStatic
val debugMockAuthApp = BrokerData(
AuthenticationConstants.Broker.MOCK_AUTH_APP_PACKAGE_NAME,
AuthenticationConstants.Broker.MOCK_AUTH_APP_SIGNATURE_SHA512,
"debugMockAuthApp",
AuthenticationConstants.Broker.MOCK_AUTH_APP_PACKAGE_NAME
"debugMockAuthApp"
)

@JvmStatic
val debugMockLtw = BrokerData(
AuthenticationConstants.Broker.MOCK_LTW_PACKAGE_NAME,
AuthenticationConstants.Broker.MOCK_LTW_SIGNATURE_SHA512,
"debugMockLtw",
AuthenticationConstants.Broker.MOCK_LTW_APP_LINK_REDIRECT_URL
"debugMockLtw"
)

@JvmStatic
val prodLTW = BrokerData(
AuthenticationConstants.Broker.LTW_APP_PACKAGE_NAME,
AuthenticationConstants.Broker.LTW_APP_SHA512_RELEASE_SIGNATURE,
"prodLTW",
AuthenticationConstants.Broker.LTW_APP_LINK_REDIRECT_URL
"prodLTW"
)

@JvmStatic
val debugLTW = BrokerData(
AuthenticationConstants.Broker.LTW_APP_PACKAGE_NAME,
AuthenticationConstants.Broker.LTW_APP_SHA512_DEBUG_SIGNATURE,
"debugLTW",
AuthenticationConstants.Broker.LTW_APP_LINK_REDIRECT_URL
"debugLTW"

)

Expand Down