Skip to content

Commit 73a074a

Browse files
authored
Merge pull request #175 from Azure-Samples/Shama-k/DocUpdates
#174 Removed duplicated step of add "API Permission"
2 parents 157f26b + b61f1c4 commit 73a074a

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

1. Desktop app calls Web API/README-incremental.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ You can also expose app-only permissions if parts of your API needs to be access
331331

332332
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.
333333

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)
335335

336336
## Community Help and Support
337337

2. Web API now calls Microsoft Graph/README-incremental.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ The code for `HandleChallengeFromWebApi` method is available from [TodoListClien
182182

183183
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.
184184

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+
187187
## How to deploy this sample to Azure
188188

189189
See [Readme.md](../5.Deploy-Web-API/README.md) to deploy this sample to Azure.

3.-Web-api-call-Microsoft-graph-for-personal-accounts/README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Next time a user runs the application, the user is signed-in with the same ident
7878
## How to run this sample
7979

8080
### Pre-requisites
81-
81+
8282
- [Visual Studio 2019](https://aka.ms/vsdownload) or just the [.NET Core SDK](https://www.microsoft.com/net/learn/get-started)
8383
- An Internet connection
8484
- A Windows machine (necessary if you want to run the app on Windows)
@@ -93,8 +93,9 @@ From your shell or command line:
9393

9494
```Shell
9595
git clone https://github.com/Azure-Samples/active-directory-dotnet-native-aspnetcore-v2.git
96-
cd "2. Web API now calls Microsoft Graph"
96+
cd "2. Web API now calls Microsoft Graph"
9797
```
98+
9899
or download and extract the repository .zip file.
99100

100101
> 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:
128129
- Type a key description (for instance `app secret`),
129130
- Select one of the available key durations (**In 1 year**, **In 2 years**, or **Never Expires**) as per your security concerns.
130131
- 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.
132133
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.
133134
- Click the **Add a permission** button and then:
134135
- Ensure that the **Microsoft APIs** tab is selected.
135136
- In the *Commonly used Microsoft APIs* section, click on **Microsoft Graph**
136137
- In the **Delegated permissions** section, select the **User.Read** in the list. Use the search box if necessary.
137138
- 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.
143139
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.
144140
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:
145141
- 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.
184180
#### Configure the client app (TodoListClient-and-Service) to use your app registration
185181

186182
Open the project in your IDE (like Visual Studio) to configure the code.
183+
187184
1. In the *TodoListClient* project, open `App.config`.
188185
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.
189186
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`.
190187
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+
192189
### Step 3: Run the sample
193190

194191
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
275272
}
276273
}
277274
```
275+
278276
See [WithExtraScopeToConsent](https://docs.microsoft.com/azure/active-directory/develop/scenario-desktop-acquire-token#withextrascopetoconsent) for more details.
279277

280278
### Changes to the service side (TodoListService)

0 commit comments

Comments
 (0)