Skip to content

Commit

Permalink
Expose validation API (#1806)
Browse files Browse the repository at this point in the history
This is done so that CP no longer need to rely on the actual classes in
common (Which will change a lot as we start supporting LTW)

They can now consume this public API, and we won't be breaking them with
internal changes.
  • Loading branch information
rpdome committed Apr 20, 2023
1 parent 46e8191 commit e071644
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
import com.microsoft.identity.common.adal.internal.tokensharing.TokenShareUtility;
import com.microsoft.identity.common.components.AndroidPlatformComponentsFactory;
import com.microsoft.identity.common.crypto.AndroidAuthSdkStorageEncryptionManager;
import com.microsoft.identity.common.internal.broker.BrokerValidator;
import com.microsoft.identity.common.internal.cache.SharedPreferencesFileManager;
import com.microsoft.identity.common.internal.commands.DeviceCodeFlowCommand;
import com.microsoft.identity.common.internal.commands.DeviceCodeFlowCommandCallback;
Expand Down Expand Up @@ -2231,4 +2232,14 @@ private static boolean isAccountHomeTenant(@Nullable final Map<String, ?> claims
return isAccountHomeTenant;
}

/**
* Returns true if the provided package name is a valid broker app.
*
* @param context application context.
* @param packageName package name of the app to be verified.
**/
public boolean isValidBrokerPackage(@NonNull final Context context,
@NonNull final String packageName){
return new BrokerValidator(context).isValidBrokerPackage(packageName);
}
}

0 comments on commit e071644

Please sign in to comment.