You can also get the desired behavior where users of your applications need to provide only user name and password just like Azure PowerShell.
This is what you can do too.
a) In order for users, outside your tenant directory, to access your web api the web api needs to be multi-tenant. Let's say you went ahead and configured this in Azure AD.
b) Next, you create a native application in your directory with delegated permissions to your web api.
c) Then, you add the native client app ID into the web api knownClientIds property by updating its manifest. The reason you do this is for consent flow, which after user's approval gets the Web API SPN provisioned in the user's directory. This needs to happen for multi-tenant apps. Read more here.
Now, let's say you ship an application that makes calls to the Web API (e.g. Azure powerShell). You can simply hardcode the client ID and APP ID URI (redirect URI) in your application and users don't need to provide it.
But the most important thing now is to use the correct ADAL API.
If you use the below API, this will raise an error
var uc = new UserCredential(userName, userPassword);
authresult = context.AcquireToken(webapiresourceid, nativeclientID, uc);
AADSTS65001: The user or administrator has not consented to use the application with ID '<app id guid>'. Send an interactive authorization request for this user and resource.
The reason is the user has to consent since the Web API is multi-tenant. For native client applications this is not needed since they are multi-tenant by default.
So, you have to use the below API and this will raise consent form (only first time)
result = context.AcquireToken(
webapiresourceid,
nativeclientID,
new Uri("nativeclientRedirectURI"),
PromptBehavior.Auto,
new UserIdentifier(userName, UserIdentifierType.RequiredDisplayableId));
Note, native client ID and native client URI both can be hardcoded just like how Azure PowerShell did it in above answer.