Skip to content

Commit e1474e4

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/azure-docs-pr into 1414791-clean-up-broken-azure-docs-pr-links-9-30
2 parents ae3900b + 516d8fc commit e1474e4

File tree

349 files changed

+4844
-1599
lines changed

Some content is hidden

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

349 files changed

+4844
-1599
lines changed

.openpublishing.redirection.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42115,6 +42115,21 @@
4211542115
"source_path": "articles/cloudfoundry/use-osba-pcf-app.md",
4211642116
"redirect_url": "/azure/cloudfoundry",
4211742117
"redirect_document_id": false
42118+
},
42119+
{
42120+
"source_path": "articles/security/compliance/azure-services-in-fedramp-auditscope.md",
42121+
"redirect_url": "/azure/azure-government/compliance/azure-services-in-fedramp-auditscope",
42122+
"redirect_document_id": false
42123+
},
42124+
{
42125+
"source_path": "articles/security/compliance/compliance-tic.md",
42126+
"redirect_url": "/azure/azure-government/compliance/compliance-tic",
42127+
"redirect_document_id": false
42128+
},
42129+
{
42130+
"source_path": "articles/security/compliance/secure-azure-computing-architecture.md",
42131+
"redirect_url": "/azure/azure-government/compliance/secure-azure-computing-architecture",
42132+
"redirect_document_id": false
4211842133
}
4211942134
]
4212042135
}

articles/active-directory-b2c/active-directory-b2c-devquickstarts-graph-dotnet.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,11 @@ To use the Azure AD Graph API with your B2C tenant, you need to register an appl
4545

4646
### Assign API access permissions
4747

48-
1. On the **Registered app** overview page, select **Settings**.
49-
1. Under **API ACCESS**, select **Required permissions**.
50-
1. Select **Windows Azure Active Directory**.
51-
1. Under **APPLICATION PERMISSIONS**, select **Read and write directory data**.
52-
1. Select **Save**.
53-
1. Select **Grant permissions**, and then select **Yes**. It might take a few minutes to for the permissions to fully propagate.
48+
[!INCLUDE [active-directory-b2c-permissions-directory](../../includes/active-directory-b2c-permissions-directory.md)]
5449

5550
### Create client secret
5651

57-
1. Under **API ACCESS**, select **Keys**.
58-
1. Enter a description for the key in the **Key description** box. For example, *Management Key*.
59-
1. Select a validity **Duration** and then select **Save**.
60-
1. Record the key's **VALUE**. You use this value for configuration in a later step.
52+
[!INCLUDE [active-directory-b2c-client-secret](../../includes/active-directory-b2c-client-secret.md)]
6153

6254
You now have an application that has permission to *create*, *read*, and *update* users in your Azure AD B2C tenant. Continue to the next section to add user *delete* and *password update* permissions.
6355

articles/active-directory-b2c/active-directory-b2c-reference-audit-logs.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ Follow these steps register an application, grant it the required Microsoft Grap
108108

109109
### Create client secret
110110

111-
1. Under **API ACCESS**, select **Keys**.
112-
1. Enter a description for the key in the **Key description** box. For example, *Audit Log Key*.
113-
1. Select a validity **Duration**, then select **Save**.
114-
1. Record the key's **VALUE**. You need this value for authentication in automation scripts like the example PowerShell script shown in a later section.
111+
[!INCLUDE [active-directory-b2c-client-secret](../../includes/active-directory-b2c-client-secret.md)]
115112

116113
You now have an application with the required API access, an application ID, and a key that you can use in your automation scripts. See the PowerShell script section later in this article for an example of how you can get activity events with a script.
117114

articles/active-directory-b2c/active-directory-b2c-user-migration.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,13 @@ First, register an application that you can use for management tasks like user m
5555

5656
Next, grant the application the Azure AD Graph API permissions required for writing to the directory.
5757

58-
1. In the **Settings** menu, select **Required permissions**.
59-
1. Select **Windows Azure Active Directory**.
60-
1. In the **Enable Access** pane, under **Application Permissions**, select **Read and write directory data**, and then select **Save**.
61-
1. In the **Required permissions** pane, select **Grant Permissions**, then select **Yes**.
62-
63-
![Read/write directory checkbox, Save, and Grant permissions highlighted](media/active-directory-b2c-user-migration/pre-migration-app-registration-permissions.png)
58+
[!INCLUDE [active-directory-b2c-permissions-directory](../../includes/active-directory-b2c-permissions-directory.md)]
6459

6560
### Step 1.3: Create the application secret
6661

6762
Create a client secret (key) for use by the user migration application that you configure in a later step.
6863

69-
1. In the **Registered app** page, select **Settings**.
70-
1. Select **Keys**.
71-
1. Under **Passwords**, add a new key (also known as a client secret) named *MyClientSecret* or another name of your choosing, select an expiration window, select **Save**, and then copy the key value for later use.
72-
73-
![Application ID value and Keys menu item highlighted in Azure portal](media/active-directory-b2c-user-migration/pre-migration-app-id-and-key.png)
64+
[!INCLUDE [active-directory-b2c-client-secret](../../includes/active-directory-b2c-client-secret.md)]
7465

7566
Now you have an application with permissions to create, read, and update users in your Azure AD B2C tenant.
7667

articles/active-directory-b2c/secure-api-management.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,17 @@ If you see the `401` status code, you've verified that only callers with a valid
199199

200200
## Support multiple applications and issuers
201201

202-
Several applications typically interact with a single REST API. To allow multiple applications to call your API, add their application IDs to the `<audiences>` element in the APIM inbound policy.
202+
Several applications typically interact with a single REST API. To enable your API to accept tokens intended for multiple applications, add their application IDs to the `<audiences>` element in the APIM inbound policy.
203203

204204
```XML
205-
<!-- Accept requests from multiple applications -->
205+
<!-- Accept tokens intended for these recipient applications -->
206206
<audiences>
207207
<audience>44444444-0000-0000-0000-444444444444</audience>
208208
<audience>66666666-0000-0000-0000-666666666666</audience>
209209
</audiences>
210210
```
211211

212-
Similarly, to support multiple token issuers, add their endpoint URIs to the `<audiences>` element in the APIM inbound policy.
212+
Similarly, to support multiple token issuers, add their endpoint URIs to the `<issuers>` element in the APIM inbound policy.
213213

214214
```XML
215215
<!-- Accept tokens from multiple issuers -->

articles/active-directory/develop/TOC.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@
276276
href: authentication-national-cloud.md
277277
- name: Authentication
278278
href: msal-national-cloud.md
279+
- name: Automatic user provisioning (SCIM)
280+
items:
281+
- name: What is automatic user provisioning?
282+
href: /azure/active-directory/manage-apps/user-provisioning
283+
- name: Building and integrating a SCIM endpoint
284+
href: /azure/active-directory/manage-apps/use-scim-to-provision-users-and-groups
279285
- name: How-to guides
280286
items:
281287
- name: Authentication

articles/active-directory/develop/msal-net-token-cache-serialization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ In web apps or web APIs the cache could leverage the session, a Redis cache, or
274274

275275
In web apps or web APIs, keep one token cache per account. For web apps, the token cache should be keyed by the account ID. For web APIs, the account should be keyed by the hash of the token used to call the API. MSAL.NET provides custom token cache serialization in .NET Framework and .NET Core subplatforms. Events are fired when the cache is accessed, apps can choose whether to serialize or deserialize the cache. On confidential client applications that handle users (web apps that sign in users and call web APIs, and web APIs calling downstream web APIs), there can be many users and the users are processed in parallel. For security and performance reasons, our recommendation is to serialize one cache per user. Serialization events compute a cache key based on the identity of the processed user and serialize/deserialie a token cache for that user.
276276

277-
Examples of how to use token caches for web apps and web APIs are available in the [ASP.NET Core web app tutorial](https://ms-identity-aspnetcore-webapp-tutorial) in the phase [2-2 Token Cache](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/2-WebApp-graph-user/2-2-TokenCache). For implementations have a look at the following folder [TokenCacheProviders](https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet/tree/master/src/Microsoft.Identity.Client.Extensions.Web/TokenCacheProviders) in the [microsoft-authentication-extensions-for-dotnet](https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet) library (in the [Microsoft.Identity.Client.Extensions.Web](https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet/tree/master/src/Microsoft.Identity.Client.Extensions.Web) folder.
277+
Examples of how to use token caches for web apps and web APIs are available in the [ASP.NET Core web app tutorial](https://ms-identity-aspnetcore-webapp-tutorial) in the phase [2-2 Token Cache](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/2-WebApp-graph-user/2-2-TokenCache). For implementations have a look at the folder [TokenCacheProviders](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/Microsoft.Identity.Web/TokenCacheProviders) in the [microsoft-authentication-extensions-for-dotnet](https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet) library (in the [Microsoft.Identity.Client.Extensions.Web](https://github.com/AzureAD/microsoft-authentication-extensions-for-dotnet/tree/master/src/Microsoft.Identity.Client.Extensions.Web) folder.
278278

279279
## Next steps
280280
The following samples illustrate token cache serialization.

articles/active-directory/develop/scenario-web-app-call-api-acquire-token.md

Lines changed: 89 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.devlang: na
1212
ms.topic: conceptual
1313
ms.tgt_pltfrm: na
1414
ms.workload: identity
15-
ms.date: 09/09/2019
15+
ms.date: 09/30/2019
1616
ms.author: jmprieur
1717
ms.custom: aaddev
1818
#Customer intent: As an application developer, I want to know how to write a Web app that calls web APIs using the Microsoft identity platform for developers.
@@ -26,55 +26,55 @@ Now that you have built you client application object, you'll use it to acquire
2626
- Getting a token for the web API using the token cache. To get this token, you call `AcquireTokenSilent`.
2727
- Calling the protected API with the access token.
2828

29-
## ASP.NET Core
29+
# [ASP.NET Core](#tab/aspnetcore)
3030

3131
The controller methods are protected by an `[Authorize]` attribute that forces users being authenticated to use the Web App. Here is the code that calls Microsoft Graph.
3232

3333
```CSharp
3434
[Authorize]
3535
public class HomeController : Controller
3636
{
37-
...
37+
readonly ITokenAcquisition tokenAcquisition;
38+
39+
public HomeController(ITokenAcquisition tokenAcquisition)
40+
{
41+
this.tokenAcquisition = tokenAcquisition;
42+
}
43+
44+
// Code for the controller actions(see code below)
45+
3846
}
3947
```
4048

49+
The `ITokenAcquisition` service is injected by ASP.NET through dependency injection.
50+
51+
4152
Here is a simplified code of the action of the HomeController, which gets a token to call the Microsoft Graph.
4253

4354
```CSharp
4455
public async Task<IActionResult> Profile()
4556
{
46-
var application = BuildConfidentialClientApplication(HttpContext, HttpContext.User);
47-
string accountIdentifier = claimsPrincipal.GetMsalAccountId();
48-
string loginHint = claimsPrincipal.GetLoginHint();
49-
50-
// Get the account
51-
IAccount account = await application.GetAccountAsync(accountIdentifier);
52-
53-
// Special case for guest users as the Guest iod / tenant id are not surfaced.
54-
if (account == null)
55-
{
56-
var accounts = await application.GetAccountsAsync();
57-
account = accounts.FirstOrDefault(a => a.Username == loginHint);
58-
}
59-
60-
AuthenticationResult result;
61-
result = await application.AcquireTokenSilent(new []{"user.read"}, account)
62-
.ExecuteAsync();
63-
var accessToken = result.AccessToken;
64-
...
65-
// use the access token to call a web API
57+
// Acquire the access token
58+
string[] scopes = new string[]{"user.read"};
59+
string accessToken = await tokenAcquisition.GetAccessTokenOnBehalfOfUserAsync(scopes);
60+
61+
// use the access token to call a protected web API
62+
HttpClient client = new HttpClient();
63+
client.DefaultRequestHeaders.Add("Authorization", result.CreateAuthorizationHeader());
64+
string json = await client.GetStringAsync(url);
6665
}
6766
```
6867

6968
To understand more thoroughly the code required for this scenario, see the phase 2 ([2-1-Web App Calls Microsoft Graph](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/2-WebApp-graph-user/2-1-Call-MSGraph)) step of the [ms-identity-aspnetcore-webapp-tutorial](https://github.com/Azure-Samples/ms-identity-aspnetcore-webapp-tutorial) tutorial.
7069

7170
There are many additional complexities, such as:
7271

73-
- Implementing a token cache for the Web App (the tutorial presents several implementations)
74-
- Removing the account from the cache when the user signs out
75-
- Calling several APIs, including having incremental consent
72+
- Calling several APIs,
73+
- processing incremental consent and conditional access.
7674

77-
## ASP.NET
75+
These advanced steps are processed in chapter 3 of the tutorial [3-WebApp-multi-APIs](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/3-WebApp-multi-APIs)
76+
77+
# [ASP.NET](#tab/aspnet)
7878

7979
Things are similar in ASP.NET:
8080

@@ -84,6 +84,68 @@ Things are similar in ASP.NET:
8484

8585
The code is similar to the code shown for ASP.NET Core.
8686

87+
# [Java](#tab/java)
88+
89+
In the Java sample, the code that calls an API is in the getUsersFromGraph method [AuthPageController.java#L62](https://github.com/Azure-Samples/ms-identity-java-webapp/blob/d55ee4ac0ce2c43378f2c99fd6e6856d41bdf144/src/main/java/com/microsoft/azure/msalwebsample/AuthPageController.java#L62).
90+
91+
It attempts to call `getAuthResultBySilentFlow`. If the user needs to consent to more scopes, the code processes the `MsalInteractionRequiredException` to challenge the user.
92+
93+
```java
94+
@RequestMapping("/msal4jsample/graph/users")
95+
public ModelAndView getUsersFromGraph(HttpServletRequest httpRequest, HttpServletResponse response)
96+
throws Throwable {
97+
98+
IAuthenticationResult result;
99+
ModelAndView mav;
100+
try {
101+
result = authHelper.getAuthResultBySilentFlow(httpRequest, response);
102+
} catch (ExecutionException e) {
103+
if (e.getCause() instanceof MsalInteractionRequiredException) {
104+
105+
// If silent call returns MsalInteractionRequired, then redirect to Authorization endpoint
106+
// so user can consent to new scopes
107+
String state = UUID.randomUUID().toString();
108+
String nonce = UUID.randomUUID().toString();
109+
110+
SessionManagementHelper.storeStateAndNonceInSession(httpRequest.getSession(), state, nonce);
111+
112+
String authorizationCodeUrl = authHelper.getAuthorizationCodeUrl(
113+
httpRequest.getParameter("claims"),
114+
"User.ReadBasic.all",
115+
authHelper.getRedirectUriGraphUsers(),
116+
state,
117+
nonce);
118+
119+
return new ModelAndView("redirect:" + authorizationCodeUrl);
120+
} else {
121+
122+
mav = new ModelAndView("error");
123+
mav.addObject("error", e);
124+
return mav;
125+
}
126+
}
127+
// Code omitted here.
128+
```
129+
130+
# [Python](#tab/python)
131+
132+
In the python sample, the code calling Microsoft graph is in [app.py#L53-L62](https://github.com/Azure-Samples/ms-identity-python-webapp/blob/48637475ed7d7733795ebeac55c5d58663714c60/app.py#L53-L62).
133+
134+
It attempts to get a token from the token cache, and then calls the eb API after setting the authorization header. If it can't, it re-signs in the user.
135+
136+
```python
137+
@app.route("/graphcall")
138+
def graphcall():
139+
token = _get_token_from_cache(app_config.SCOPE)
140+
if not token:
141+
return redirect(url_for("login"))
142+
graph_data = requests.get( # Use token to call downstream service
143+
app_config.ENDPOINT,
144+
headers={'Authorization': 'Bearer ' + token['access_token']},
145+
).json()
146+
return render_template('display.html', result=graph_data)
147+
```
148+
87149
## Next steps
88150
89151
> [!div class="nextstepaction"]

0 commit comments

Comments
 (0)