You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1. Desktop app calls Web API/README-incremental.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -331,7 +331,7 @@ You can also expose app-only permissions if parts of your API needs to be access
331
331
332
332
In the next chapter, we will enhance this Web API to call another downstream Web API (Microsoft Graph) on behalf of the user signed in to the WPF application.
333
333
334
-
See [2. Web API now calls Microsoft Graph](../2.%20Web%20API%20now%20calls%20Microsoft%20Graph/README-Incremental.md)
334
+
See [2. Web API now calls Microsoft Graph](../2.%20Web%20API%20now%20calls%20Microsoft%20Graph/README-incremental.md)
Copy file name to clipboardExpand all lines: 2. Web API now calls Microsoft Graph/README-incremental.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -182,8 +182,8 @@ The code for `HandleChallengeFromWebApi` method is available from [TodoListClien
182
182
183
183
In the next chapter, we will enhance this Web API to call another downstream Web API (Microsoft Graph) on behalf of the user signed in to the WPF application.
184
184
185
-
See [3.-Web-api-call-Microsoft-graph-for-personal-accounts](../3.-Web-api-call-Microsoft-graph-for-personal-accounts/README-Incremental.md)
186
-
185
+
See [3.-Web-api-call-Microsoft-graph-for-personal-accounts](../3.-Web-api-call-Microsoft-graph-for-personal-accounts/README-incremental.md)
186
+
187
187
## How to deploy this sample to Azure
188
188
189
189
See [Readme.md](../5.Deploy-Web-API/README.md) to deploy this sample to Azure.
> Given that the name of the sample is quite long, and so are the names of the referenced NuGet packages, you might want to clone it in a folder close to the root of your hard drive, to avoid file size limitations on Windows.
@@ -128,18 +129,13 @@ As a first step you'll need to:
128
129
- Type a key description (for instance `app secret`),
129
130
- Select one of the available key durations (**In 1 year**, **In 2 years**, or **Never Expires**) as per your security concerns.
130
131
- The generated key value will be displayed when you click the **Add** button. Copy the generated value for use in the steps later.
131
-
- You'll need this key later in your code's configuration files. This key value will not be displayed again, and is not retrievable by any other means, so make sure to note it from the Azure portal before navigating to any other screen or blade.
132
+
- You'll need this key later in your code's configuration files. This key value will not be displayed again, and is not retrievable by any other means, so make sure to note it from the Azure portal before navigating to any other screen or blade.
132
133
1. In the app's registration screen, click on the **API permissions** blade in the left to open the page where we add access to the APIs that your application needs.
133
134
- Click the **Add a permission** button and then:
134
135
- Ensure that the **Microsoft APIs** tab is selected.
135
136
- In the *Commonly used Microsoft APIs* section, click on **Microsoft Graph**
136
137
- In the **Delegated permissions** section, select the **User.Read** in the list. Use the search box if necessary.
137
138
- Click on the **Add permissions** button at the bottom.
138
-
- Click the **Add a permission** button and then:
139
-
- Ensure that the **My APIs** tab is selected.
140
-
- In the list of APIs, select the API `TodoListClient-and-Service`.
141
-
- In the **Delegated permissions** section, select the **access_as_user** in the list. Use the search box if necessary.
142
-
- Click on the **Add permissions** button at the bottom.
143
139
1. In the app's registration screen, select the **Expose an API** blade to the left to open the page where you can declare the parameters to expose this app as an API for which client applications can obtain [access tokens](https://docs.microsoft.com/azure/active-directory/develop/access-tokens) for.
144
140
The first thing that we need to do is to declare the unique [resource](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow) URI that the clients will be using to obtain access tokens for this API. To declare an resource URI, follow the following steps:
145
141
- Click `Set` next to the **Application ID URI** to generate a URI that is unique for this app.
@@ -184,11 +180,12 @@ Open the project in your IDE (like Visual Studio) to configure the code.
184
180
#### Configure the client app (TodoListClient-and-Service) to use your app registration
185
181
186
182
Open the project in your IDE (like Visual Studio) to configure the code.
183
+
187
184
1. In the *TodoListClient* project, open `App.config`.
188
185
2. Find the app key `ida:ClientId` and replace the value with the ApplicationID (Client ID) for the *TodoListClient-and-Service* app copied from the app registration page.
189
186
3. and replace the value with the scope of the TodoListClient-and-Service application copied from the app registration in the **Expose an API** tab, i.e `api://{clientId}/access_as_user`.
190
187
4.[Optional] If you changed the default URL for your service application, find the app key `todo:TodoListBaseAddress` and replace the value with the base address of the TodoListService project.
191
-
188
+
192
189
### Step 3: Run the sample
193
190
194
191
Clean the solution, rebuild the solution, and run it. You might want to go into the solution properties and set both projects as startup projects, with the service project starting first.
@@ -275,6 +272,7 @@ public class MainWindow
275
272
}
276
273
}
277
274
```
275
+
278
276
See [WithExtraScopeToConsent](https://docs.microsoft.com/azure/active-directory/develop/scenario-desktop-acquire-token#withextrascopetoconsent) for more details.
0 commit comments