2929import com .microsoft .identity .common .java .logging .Logger ;
3030import com .microsoft .identity .common .java .nativeauth .authorities .NativeAuthCIAMAuthority ;
3131import com .microsoft .identity .common .java .providers .microsoft .azureactivedirectory .AzureActiveDirectory ;
32+ import com .microsoft .identity .common .java .providers .microsoft .azureactivedirectory .AzureActiveDirectoryEnvironment ;
3233import com .microsoft .identity .common .java .providers .microsoft .azureactivedirectory .AzureActiveDirectorySlice ;
3334import com .microsoft .identity .common .java .providers .oauth2 .OAuth2Strategy ;
3435import com .microsoft .identity .common .java .providers .oauth2 .OAuth2StrategyParameters ;
3536import com .microsoft .identity .common .java .util .CommonURIBuilder ;
3637import com .microsoft .identity .common .java .util .StringUtil ;
3738
38- import java .io .IOException ;
3939import java .net .MalformedURLException ;
4040import java .net .URI ;
4141import java .net .URISyntaxException ;
@@ -107,8 +107,8 @@ public void setDefault(Boolean isDefault) {
107107 }
108108
109109
110- @ SuppressFBWarnings (value = "RpC_REPEATED_CONDITIONAL_TEST" ,
111- justification = "Somehow, spotbugs thinks that BuildConfig.SLICE and BuildConfig.DC are the same values." )
110+ @ SuppressFBWarnings (value = "RpC_REPEATED_CONDITIONAL_TEST" ,
111+ justification = "Somehow, spotbugs thinks that BuildConfig.SLICE and BuildConfig.DC are the same values." )
112112 public Authority () {
113113 // setting slice directly here in constructor if slice provided as command line param
114114 if (!StringUtil .isNullOrEmpty (BuildConfig .SLICE ) || !StringUtil .isNullOrEmpty (BuildConfig .DC )) {
@@ -134,7 +134,7 @@ public static Authority getAuthorityFromAuthorityUrl(String authorityUrl) {
134134 * determine the authority type and tenantid associated with it.
135135 *
136136 * @param authorityUrl
137- * @param clientId This parameter is optional and can be null. It is used to construct NativeAuthCIAMAuthority when authority type is AAD_NA.
137+ * @param clientId This parameter is optional and can be null. It is used to construct NativeAuthCIAMAuthority when authority type is AAD_NA.
138138 * @return
139139 */
140140 public static Authority getAuthorityFromAuthorityUrl (String authorityUrl , @ Nullable String clientId ) {
@@ -150,7 +150,7 @@ public static Authority getAuthorityFromAuthorityUrl(String authorityUrl, @Nulla
150150
151151 // Adding check in case we have a trailing "/" at the end of the authority
152152 if (pathSegments .size () == 0 || (pathSegments .size () == 1 && pathSegments .get (0 ).equals ("" ))) {
153- if (authorityUrl .contains (CIAMAuthority .CIAM_LOGIN_URL_SEGMENT )){
153+ if (authorityUrl .contains (CIAMAuthority .CIAM_LOGIN_URL_SEGMENT )) {
154154 // This is a CIAM authority, return CIAMAuthority
155155 return new CIAMAuthority (CIAMAuthority .getTenantNameVariantUrlFromAuthorityWithoutPath (authorityUrl ));
156156 }
@@ -351,7 +351,7 @@ public static boolean isKnownAuthority(Authority authority) {
351351 return false ;
352352 }
353353
354- if (BuildConfig .ALLOW_ONEBOX_AUTHORITIES ) {
354+ if (BuildConfig .ALLOW_ONEBOX_AUTHORITIES && AzureActiveDirectoryEnvironment . ONEBOX_AUTHORITY . equals ( authority . getAuthorityURL (). getAuthority ()) ) {
355355 return true ; // onebox authorities are always considered to be known.
356356 }
357357
0 commit comments