, , Azure PowerShell.
, .
a) , , -, -api . , Azure AD.
b) - api.
c) web api knownClientIds, . , , - , SPN Web API, . . .
, , -API (, Azure powerShell). URI APP ( URI) , .
- ADAL API.
API,
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.
, , -API . , -.
, API, ( )
result = context.AcquireToken(
webapiresourceid,
nativeclientID,
new Uri("nativeclientRedirectURI"),
PromptBehavior.Auto,
new UserIdentifier(userName, UserIdentifierType.RequiredDisplayableId));
. URI , Azure PowerShell .