Skip to content

Commit 6a23904

Browse files
authored
Merge pull request #234532 from MicrosoftDocs/main
4/14/2023 AM Publish
2 parents 4f425bc + 565cb34 commit 6a23904

File tree

101 files changed

+1412
-1808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1412
-1808
lines changed

.openpublishing.redirection.healthcare-apis.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,19 @@
586586
"redirect_document_id": false
587587
},
588588
{ "source_path_from_root": "/articles/healthcare-apis/iot/iot-data-flow.md",
589-
"redirect_url": "/azure/healthcare-apis/iot/understand-service",
589+
"redirect_url": "/azure/healthcare-apis/iot/overview-of-device-data-processing-stages",
590590
"redirect_document_id": false
591591
},
592592
{ "source_path_from_root": "/articles/healthcare-apis/iot/data-flow.md",
593-
"redirect_url": "/azure/healthcare-apis/iot/overview-of-device-message-processing-stages",
593+
"redirect_url": "/azure/healthcare-apis/iot/overview-of-device-data-processing-stages",
594594
"redirect_document_id": false
595595
},
596596
{ "source_path_from_root": "/articles/healthcare-apis/iot/understand-service.md",
597-
"redirect_url": "/azure/healthcare-apis/iot/overview-of-device-message-processing-stages",
597+
"redirect_url": "/azure/healthcare-apis/iot/overview-of-device-data-processing-stages",
598+
"redirect_document_id": false
599+
},
600+
{ "source_path_from_root": "/articles/healthcare-apis/iot/overview-of-device-message-processing-stages.md",
601+
"redirect_url": "/azure/healthcare-apis/iot/overview-of-device-data-processing-stages",
598602
"redirect_document_id": false
599603
},
600604
{ "source_path_from_root": "/articles/healthcare-apis/iot/how-to-use-device-mappings.md",

articles/active-directory-b2c/custom-policies-series-call-rest-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ You need to deploy an app, which will serve as your external app. Your custom po
8888
"code" : "errorCode",
8989
"requestId": "requestId",
9090
"userMessage" : "The access code you entered is incorrect. Please try again.",
91-
"developerMessage" : `The The provided code ${req.body.accessCode} does not match the expected code for user.`,
91+
"developerMessage" : `The provided code ${req.body.accessCode} does not match the expected code for user.`,
9292
"moreInfo" :"https://docs.microsoft.com/en-us/azure/active-directory-b2c/string-transformations"
9393
};
9494
res.status(409).send(errorResponse);
@@ -133,7 +133,7 @@ You need to deploy an app, which will serve as your external app. Your custom po
133133
"code": "errorCode",
134134
"requestId": "requestId",
135135
"userMessage": "The access code you entered is incorrect. Please try again.",
136-
"developerMessage": "The The provided code 54321 does not match the expected code for user.",
136+
"developerMessage": "The provided code 54321 does not match the expected code for user.",
137137
"moreInfo": "https://docs.microsoft.com/en-us/azure/active-directory-b2c/string-transformations"
138138
}
139139
```

articles/active-directory/develop/application-model.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ For an identity provider to know that a user has access to a particular app, bot
2828
* Decide if you want to allow users to sign in only if they belong to your organization. This architecture is known as a single-tenant application. Or, you can allow users to sign in by using any work or school account, which is known as a multi-tenant application. You can also allow personal Microsoft accounts or a social account from LinkedIn, Google, and so on.
2929
* Request scope permissions. For example, you can request the "user.read" scope, which grants permission to read the profile of the signed-in user.
3030
* Define scopes that define access to your web API. Typically, when an app wants to access your API, it will need to request permissions to the scopes you define.
31-
* Share a secret with the Microsoft identity platform that proves the app's identity. Using a secret is relevant in the case where the app is a confidential client application. A confidential client application is an application that can hold credentials securely. A trusted back-end server is required to store the credentials.
31+
* Share a secret with the Microsoft identity platform that proves the app's identity. Using a secret is relevant in the case where the app is a confidential client application. A confidential [client application](developer-glossary.md#client-application) is an application that can hold credentials securely, like a [web client](developer-glossary.md#web-client). A trusted back-end server is required to store the credentials.
3232

33-
After the app is registered, it's given a unique identifier that it shares with the Microsoft identity platform when it requests tokens. If the app is a [confidential client application](developer-glossary.md#client-application), it will also share the secret or the public key depending on whether certificates or secrets were used.
33+
After the app is registered, it's given a unique identifier that it shares with the Microsoft identity platform when it requests tokens. If the app is a confidential client application, it will also share the secret or the public key depending on whether certificates or secrets were used.
3434

3535
The Microsoft identity platform represents applications by using a model that fulfills two main functions:
3636

@@ -44,14 +44,14 @@ The Microsoft identity platform:
4444
* Provides infrastructure for implementing app provisioning within the app developer's tenant, and to any other Azure AD tenant.
4545
* Handles user consent during token request time and facilitates the dynamic provisioning of apps across tenants.
4646

47-
*Consent* is the process of a resource owner granting authorization for a client application to access protected resources, under specific permissions, on behalf of the resource owner. The Microsoft identity platform enables:
47+
[*Consent*](developer-glossary.md#consent) is the process of a resource owner granting authorization for a client application to access protected resources, under specific permissions, on behalf of the resource owner. The Microsoft identity platform enables:
4848

4949
* Users and administrators to dynamically grant or deny consent for the app to access resources on their behalf.
5050
* Administrators to ultimately decide what apps are allowed to do and which users can use specific apps, and how the directory resources are accessed.
5151

5252
## Multi-tenant apps
5353

54-
In the Microsoft identity platform, an [application object](developer-glossary.md#application-object) describes an application. At deployment time, the Microsoft identity platform uses the application object as a blueprint to create a [service principal](developer-glossary.md#service-principal-object), which represents a concrete instance of an application within a directory or tenant. The service principal defines what the app can actually do in a specific target directory, who can use it, what resources it has access to, and so on. The Microsoft identity platform creates a service principal from an application object through [consent](developer-glossary.md#consent).
54+
In the Microsoft identity platform, an [application object](developer-glossary.md#application-object) describes an application. At deployment time, the Microsoft identity platform uses the application object as a blueprint to create a [service principal](developer-glossary.md#service-principal-object), which represents a concrete instance of an application within a directory or tenant. The service principal defines what the app can actually do in a specific target directory, who can use it, what resources it has access to, and so on. The Microsoft identity platform creates a service principal from an application object through consent.
5555

5656
The following diagram shows a simplified Microsoft identity platform provisioning flow driven by consent. It shows two tenants: *A* and *B*.
5757

articles/active-directory/develop/reference-aadsts-error-codes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ The `error` field has several possible values - review the protocol documentatio
165165
| AADSTS50143 | Session mismatch - Session is invalid because user tenant doesn't match the domain hint due to different resource. [Open a support ticket](../fundamentals/active-directory-troubleshooting-support-howto.md) with Correlation ID, Request ID, and Error code to get more details. |
166166
| AADSTS50144 | InvalidPasswordExpiredOnPremPassword - User's Active Directory password has expired. Generate a new password for the user or have the user use the self-service reset tool to reset their password. |
167167
| AADSTS50146 | MissingCustomSigningKey - This app is required to be configured with an app-specific signing key. It is either not configured with one, or the key has expired or isn't yet valid. Please contact the owner of the application. |
168+
| AADSTS501461 | AcceptMappedClaims is only supported for a token audience matching the application GUID or an audience within the tenant's verified domains. Either change the resource identifier, or use an application-specific signing key. |
168169
| AADSTS50147 | MissingCodeChallenge - The size of the code challenge parameter isn't valid. |
169170
| AADSTS501481 | The Code_Verifier doesn't match the code_challenge supplied in the authorization request.|
170171
| AADSTS501491 | InvalidCodeChallengeMethodInvalidSize - Invalid size of Code_Challenge parameter.|
@@ -183,7 +184,7 @@ The `error` field has several possible values - review the protocol documentatio
183184
| AADSTS50194 | Application '{appId}'({appName}) isn't configured as a multi-tenant application. Usage of the /common endpoint isn't supported for such applications created after '{time}'. Use a tenant-specific endpoint or configure the application to be multi-tenant. |
184185
| AADSTS50196 | LoopDetected - A client loop has been detected. Check the app’s logic to ensure that token caching is implemented, and that error conditions are handled correctly. The app has made too many of the same request in too short a period, indicating that it is in a faulty state or is abusively requesting tokens. |
185186
| AADSTS50197 | ConflictingIdentities - The user could not be found. Try signing in again. |
186-
| AADSTS50199 | CmsiInterrupt - For security reasons, user confirmation is required for this request. Because this is an "interaction_required" error, the client should do interactive auth. This occurs because a system webview has been used to request a token for a native application - the user must be prompted to ask if this was actually the app they meant to sign into. To avoid this prompt, the redirect URI should be part of the following safe list: <br />http://<br />https://<br />chrome-extension:// (desktop Chrome browser only) |
187+
| AADSTS50199 | CmsiInterrupt - For security reasons, user confirmation is required for this request. Interrupt is shown for all scheme redirects in mobile browsers. <br />No action required. The user was asked to confirm that this app is the application they intended to sign into. <br />This is a security feature that helps prevent spoofing attacks. This occurs because a system webview has been used to request a token for a native application. <br />To avoid this prompt, the redirect URI should be part of the following safe list: <br />http://<br />https://<br />chrome-extension:// (desktop Chrome browser only) |
187188
| AADSTS51000 | RequiredFeatureNotEnabled - The feature is disabled. |
188189
| AADSTS51001 | DomainHintMustbePresent - Domain hint must be present with on-premises security identifier or on-premises UPN. |
189190
| AADSTS1000104| XCB2BResourceCloudNotAllowedOnIdentityTenant - Resource cloud {resourceCloud} isn't allowed on identity tenant {identityTenant}. {resourceCloud} - cloud instance which owns the resource. {identityTenant} - is the tenant where signing-in identity is originated from. |

articles/active-directory/develop/scenario-daemon-acquire-token.md

Lines changed: 76 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,23 @@ After you've constructed a confidential client application, you can acquire a to
2222

2323
The scope to request for a client credential flow is the name of the resource followed by `/.default`. This notation tells Azure Active Directory (Azure AD) to use the *application-level permissions* declared statically during application registration. Also, these API permissions must be granted by a tenant administrator.
2424

25-
# [.NET](#tab/dotnet)
25+
# [.NET](#tab/idweb)
2626

27-
```csharp
28-
ResourceId = "someAppIDURI";
29-
var scopes = new [] { ResourceId+"/.default"};
27+
Here's an example of defining the scopes for the web API as part of the configuration in an [*appsettings.json*](https://github.com/Azure-Samples/active-directory-dotnetcore-daemon-v2/blob/master/2-Call-OwnApi/daemon-console/appsettings.json) file. This example is taken from the [.NET Core console daemon](https://github.com/Azure-Samples/active-directory-dotnetcore-daemon-v2) code sample on GitHub.
28+
29+
```json
30+
{
31+
"AzureAd": {
32+
// Same AzureAd section as before.
33+
},
34+
35+
"MyWebApi": {
36+
"BaseUrl": "https://localhost:44372/",
37+
"RelativePath": "api/TodoList",
38+
"RequestAppToken": true,
39+
"Scopes": [ "[Enter here the scopes for your web API]" ]
40+
}
41+
}
3042
```
3143

3244
# [Java](#tab/java)
@@ -53,6 +65,13 @@ In MSAL Python, the configuration file looks like this code snippet:
5365
}
5466
```
5567

68+
# [.NET (low level)](#tab/dotnet)
69+
70+
```csharp
71+
ResourceId = "someAppIDURI";
72+
var scopes = new [] { ResourceId+"/.default"};
73+
```
74+
5675
---
5776

5877
### Azure AD (v1.0) resources
@@ -65,42 +84,25 @@ The scope used for client credentials should always be the resource ID followed
6584
6685
## AcquireTokenForClient API
6786

68-
To acquire a token for the app, you'll use `AcquireTokenForClient` or its equivalent, depending on the platform.
87+
To acquire a token for the app, use `AcquireTokenForClient` or its equivalent, depending on the platform.
6988

70-
# [.NET](#tab/dotnet)
89+
# [.NET](#tab/idweb)
90+
91+
With Microsoft.Identity.Web, you don't need to acquire a token. You can use higher level APIs, as you see in [Calling a web API from a daemon application](scenario-daemon-call-api.md). If however you're using an SDK that requires a token, the following code snippet shows how to get this token.
7192

7293
```csharp
73-
using Microsoft.Identity.Client;
94+
using Microsoft.Extensions.DependencyInjection;
95+
using Microsoft.Identity.Abstractions;
96+
using Microsoft.Identity.Web;
7497

75-
// With client credentials flows, the scope is always of the shape "resource/.default" because the
76-
// application permissions need to be set statically (in the portal or by PowerShell), and then granted by
77-
// a tenant administrator.
78-
string[] scopes = new string[] { "https://graph.microsoft.com/.default" };
98+
// In the Program.cs, acquire a token for your downstream API
7999
80-
AuthenticationResult result = null;
81-
try
82-
{
83-
result = await app.AcquireTokenForClient(scopes)
84-
.ExecuteAsync();
85-
}
86-
catch (MsalUiRequiredException ex)
87-
{
88-
// The application doesn't have sufficient permissions.
89-
// - Did you declare enough app permissions during app creation?
90-
// - Did the tenant admin grant permissions to the application?
91-
}
92-
catch (MsalServiceException ex) when (ex.Message.Contains("AADSTS70011"))
93-
{
94-
// Invalid scope. The scope has to be in the form "https://resourceurl/.default"
95-
// Mitigation: Change the scope to be as expected.
96-
}
100+
var tokenAcquirerFactory = TokenAcquirerFactory.GetDefaultInstance();
101+
ITokenAcquirer acquirer = tokenAcquirerFactory.GetTokenAcquirer();
102+
AcquireTokenResult tokenResult = await acquirer.GetTokenForUserAsync(new[] { https://graph.microsoft.com/.default" });
103+
string accessToken = tokenResult.AccessToken;
97104
```
98105

99-
### AcquireTokenForClient uses the application token cache
100-
101-
In MSAL.NET, `AcquireTokenForClient` uses the application token cache. (All the other AcquireToken*XX* methods use the user token cache.)
102-
Don't call `AcquireTokenSilent` before you call `AcquireTokenForClient`, because `AcquireTokenSilent` uses the *user* token cache. `AcquireTokenForClient` checks the *application* token cache itself and updates it.
103-
104106
# [Java](#tab/java)
105107

106108
This code is extracted from the [MSAL Java dev samples](https://github.com/AzureAD/microsoft-authentication-library-for-java/tree/dev/msal4j-sdk/src/samples/confidential-client/).
@@ -152,7 +154,7 @@ private static IAuthenticationResult acquireToken() throws Exception {
152154

153155
# [Node.js](#tab/nodejs)
154156

155-
The code snippet below illustrates token acquisition in an MSAL Node confidential client application:
157+
The following code snippet illustrates token acquisition in an MSAL Node confidential client application:
156158

157159
```JavaScript
158160
try {
@@ -187,6 +189,40 @@ else:
187189
print(result.get("correlation_id")) # You might need this when reporting a bug.
188190
```
189191

192+
# [.NET (low level)](#tab/dotnet)
193+
194+
```csharp
195+
using Microsoft.Identity.Client;
196+
197+
// With client credentials flows, the scope is always of the shape "resource/.default" because the
198+
// application permissions need to be set statically (in the portal or by PowerShell), and then granted by
199+
// a tenant administrator.
200+
string[] scopes = new string[] { "https://graph.microsoft.com/.default" };
201+
202+
AuthenticationResult result = null;
203+
try
204+
{
205+
result = await app.AcquireTokenForClient(scopes)
206+
.ExecuteAsync();
207+
}
208+
catch (MsalUiRequiredException ex)
209+
{
210+
// The application doesn't have sufficient permissions.
211+
// - Did you declare enough app permissions during app creation?
212+
// - Did the tenant admin grant permissions to the application?
213+
}
214+
catch (MsalServiceException ex) when (ex.Message.Contains("AADSTS70011"))
215+
{
216+
// Invalid scope. The scope has to be in the form "https://resourceurl/.default"
217+
// Mitigation: Change the scope to be as expected.
218+
}
219+
```
220+
221+
### AcquireTokenForClient uses the application token cache
222+
223+
In MSAL.NET, `AcquireTokenForClient` uses the application token cache. (All the other AcquireToken*XX* methods use the user token cache.)
224+
Don't call `AcquireTokenSilent` before you call `AcquireTokenForClient`, because `AcquireTokenSilent` uses the *user* token cache. `AcquireTokenForClient` checks the *application* token cache itself and updates it.
225+
190226
---
191227

192228
### Protocol
@@ -253,10 +289,10 @@ If your daemon app calls your own web API and you weren't able to add an app per
253289

254290
## Next steps
255291

256-
# [.NET](#tab/dotnet)
292+
# [.NET](#tab/idweb)
257293

258294
Move on to the next article in this scenario,
259-
[Calling a web API](./scenario-daemon-call-api.md?tabs=dotnet).
295+
[Calling a web API](./scenario-daemon-call-api.md?tabs=idweb).
260296

261297
# [Java](#tab/java)
262298

@@ -273,4 +309,8 @@ Move on to the next article in this scenario,
273309
Move on to the next article in this scenario,
274310
[Calling a web API](./scenario-daemon-call-api.md?tabs=python).
275311

312+
# [.NET low level](#tab/dotnet)
313+
314+
Move on to the next article in this scenario,
315+
[Calling a web API](./scenario-daemon-call-api.md?tabs=dotnet).
276316
---

0 commit comments

Comments
 (0)