Skip to content

Commit dc07634

Browse files
committed
comments
1 parent 1a6dfba commit dc07634

File tree

6 files changed

+21
-34
lines changed

6 files changed

+21
-34
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,28 +2151,4 @@ public static final class SdkPlatformFields {
21512151
@Deprecated
21522152
public static final String VERSION = com.microsoft.identity.common.java.AuthenticationConstants.SdkPlatformFields.VERSION;
21532153
}
2154-
2155-
public static final class PoPConstants {
2156-
/**
2157-
* Indicates caller requests a PoP token instead of bearer.
2158-
*/
2159-
public static final String SIGN_POP_TOKEN = "signPopToken";
2160-
2161-
/**
2162-
* Resource request components used to build the PoP SHR.
2163-
*/
2164-
public static final String RESOURCE_REQUEST_URI = "resourceRequestUri";
2165-
public static final String RESOURCE_REQUEST_METHOD = "resourceRequestMethod";
2166-
2167-
/**
2168-
* Optional PoP supplemental values.
2169-
*/
2170-
public static final String SHR_NONCE = "shrNonce";
2171-
public static final String SHR_CLAIMS = "shrClaims";
2172-
/**
2173-
* Key identifier for the PoP key used to sign the token.
2174-
*/
2175-
public static final String KEY_ID = "keyId";
2176-
}
21772154
}
2178-

common/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,7 @@ public String executeWebAppRequest(@NonNull final String request,
14711471
final WebAppsGetTokenSubOperationRequest getTokenRequest = envelope.getRequest();
14721472
// If need to do interactive right away, do it now.
14731473
// Otherwise, just let the broker handle the silent token acquisition first.
1474-
if (shouldForceInteractive(getTokenRequest, additionalRequiredParams.getCanShowUi())) {
1474+
if (shouldForceInteractiveRequestForWebApp(getTokenRequest, additionalRequiredParams.getCanShowUi())) {
14751475
AzureActiveDirectory.buildAndValidateAuthorityFromWebAppSender(envelope.getSender());
14761476
final BrokerInteractiveTokenCommandParameters interactiveParams =
14771477
buildInteractiveTokenParametersForWebApps(getTokenRequest, additionalRequiredParams, minBrokerProtocolVersion);
@@ -1524,7 +1524,7 @@ public String extractResultBundle(@Nullable final Bundle resultBundle) throws Ba
15241524
WebAppsGetTokenSubOperationEnvelope.class
15251525
);
15261526
final WebAppsGetTokenSubOperationRequest getTokenRequest = envelope.getRequest();
1527-
if (canFallbackToInteractive(getTokenRequest, additionalRequiredParams.getCanShowUi())) {
1527+
if (canFallbackToInteractiveRequestForWebApp(getTokenRequest, additionalRequiredParams.getCanShowUi())) {
15281528
// Create params from the request
15291529
if (getTokenRequest.isSecurityTokenService()) {
15301530
// Validate sender authority (throws if invalid)
@@ -1700,8 +1700,8 @@ private void verifyBrokerVersionIsSupported(@Nullable final Bundle resultBundle,
17001700
* @return True if interactive token acquisition should be forced, false otherwise.
17011701
* @throws ClientException if prompt is not none and UI is not allowed.
17021702
*/
1703-
private boolean shouldForceInteractive(final @NonNull WebAppsGetTokenSubOperationRequest req,
1704-
final boolean canShowUI) throws ClientException {
1703+
private boolean shouldForceInteractiveRequestForWebApp(final @NonNull WebAppsGetTokenSubOperationRequest req,
1704+
final boolean canShowUI) throws ClientException {
17051705
// MSAL JS requests will always be silent first.
17061706
if (!req.isSecurityTokenService() || !StringUtil.isNullOrEmpty(req.getHomeAccountId())) {
17071707
return false;
@@ -1729,8 +1729,8 @@ private boolean shouldForceInteractive(final @NonNull WebAppsGetTokenSubOperatio
17291729
* @return True if we can fallback to interactive token acquisition, false otherwise.
17301730
* @throws ClientException if prompt is none or if UI is not allowed when prompt is not none.
17311731
*/
1732-
private boolean canFallbackToInteractive(@NonNull final WebAppsGetTokenSubOperationRequest req,
1733-
final boolean canShowUI) throws ClientException {
1732+
private boolean canFallbackToInteractiveRequestForWebApp(@NonNull final WebAppsGetTokenSubOperationRequest req,
1733+
final boolean canShowUI) throws ClientException {
17341734
final OpenIdConnectPromptParameter prompt = OpenIdConnectPromptParameter.fromString(req.getPrompt());
17351735
if (prompt == OpenIdConnectPromptParameter.NONE) {
17361736
return false;

common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerInteractiveTokenCommandParameters.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import com.microsoft.identity.common.java.cache.BrokerOAuth2TokenCache;
2828
import com.microsoft.identity.common.java.exception.ArgumentException;
2929
import com.microsoft.identity.common.java.exception.ClientException;
30+
import com.microsoft.identity.common.java.flighting.CommonFlight;
31+
import com.microsoft.identity.common.java.flighting.CommonFlightsManager;
3032
import com.microsoft.identity.common.java.request.BrokerRequestType;
3133
import com.microsoft.identity.common.java.util.IPlatformUtil;
3234
import com.microsoft.identity.common.java.util.StringUtil;
@@ -124,7 +126,8 @@ public void validate() throws ArgumentException, ClientException {
124126
);
125127
}
126128
final IPlatformUtil platformUtil = getPlatformComponents().getPlatformUtil();
127-
if (getRequestType() == BrokerRequestType.WEB_APPS) {
129+
if (!CommonFlightsManager.INSTANCE.getFlightsProvider().isFlightEnabled(CommonFlight.DISABLE_WEB_APPS_API)
130+
&& getRequestType() == BrokerRequestType.WEB_APPS) {
128131
// For web apps, we have a different redirect URI from our standard Android one.
129132
platformUtil.isValidCallingAppForWebApps(getCallerUid());
130133
return;

common4j/src/main/com/microsoft/identity/common/java/commands/parameters/BrokerSilentTokenCommandParameters.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import com.microsoft.identity.common.java.cache.BrokerOAuth2TokenCache;
2828
import com.microsoft.identity.common.java.exception.ArgumentException;
2929
import com.microsoft.identity.common.java.exception.ClientException;
30+
import com.microsoft.identity.common.java.flighting.CommonFlight;
31+
import com.microsoft.identity.common.java.flighting.CommonFlightsManager;
3032
import com.microsoft.identity.common.java.request.BrokerRequestType;
3133
import com.microsoft.identity.common.java.util.IPlatformUtil;
3234
import com.microsoft.identity.common.java.util.StringUtil;
@@ -116,7 +118,8 @@ public void validate() throws ArgumentException, ClientException {
116118
);
117119
}
118120
final IPlatformUtil platformUtil = getPlatformComponents().getPlatformUtil();
119-
if (getRequestType() == BrokerRequestType.WEB_APPS) {
121+
if (!CommonFlightsManager.INSTANCE.getFlightsProvider().isFlightEnabled(CommonFlight.DISABLE_WEB_APPS_API)
122+
&& getRequestType() == BrokerRequestType.WEB_APPS) {
120123
// For web apps, we have a different redirect URI from our standard Android one.
121124
platformUtil.isValidCallingAppForWebApps(getCallerUid());
122125
return;

common4j/src/main/com/microsoft/identity/common/java/commands/webapps/WebAppsGetTokenSubOperationEnvelope.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ data class WebAppsGetTokenSubOperationEnvelope(
4343
const val FIELD_REQUEST = "request"
4444
const val FIELD_SENDER = "sender"
4545
}
46-
}
46+
}

common4j/src/main/com/microsoft/identity/common/java/flighting/CommonFlight.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,12 @@ public enum CommonFlight implements IFlightConfig {
180180
* Flight to enable OpenID issuer validation code which validates issuer against the open id well known
181181
* config endpoint and only reports the failure result.
182182
*/
183-
ENABLE_OPENID_ISSUER_VALIDATION_REPORTING("EnableOpenIdIssuerValidationReporting", true);
183+
ENABLE_OPENID_ISSUER_VALIDATION_REPORTING("EnableOpenIdIssuerValidationReporting", true),
184+
185+
/**
186+
* Flight to disable Web Apps API.
187+
*/
188+
DISABLE_WEB_APPS_API("DisableWebAppsApi", false);
184189

185190
private String key;
186191
private Object defaultValue;

0 commit comments

Comments
 (0)