Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jmprieur committed Apr 2, 2019
1 parent e94fbf7 commit 7f80732
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
12 changes: 6 additions & 6 deletions 1. Desktop app calls Web API/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ If you want to use this automation:
```
> Other ways of running the scripts are described in [App Creation Scripts](./AppCreationScripts/AppCreationScripts.md)
1. In the list of pages for the application registration of the `TodoListService-v2` application, select **Manifest**
1. In the application registration page for the `TodoListService-v2` application, select the **Manifest** section
- in the manifest, search for **"accessTokenAcceptedVersion"**, and replace **null** by **2**. This property lets Azure AD know that the Web API accepts v2.0 tokens
- Select **Save**

Expand Down Expand Up @@ -136,7 +136,7 @@ If you want to register your apps manually, as a first step you'll need to:
- Select **Register** to create the application.

1. On the app **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the Visual Studio configuration file for this project (`ClientId` in `TodoListService\appsettings.json`).
1. In the list of pages for the app, select **Expose an API**
1. Select the **Expose an API** section, and:
- Select **Add a scope**
- accept the proposed Application ID URI (api://{clientId}) by selecting **Save and Continue**
- Enter the following parameters:
Expand All @@ -148,7 +148,7 @@ If you want to register your apps manually, as a first step you'll need to:
- in **User consent description** type `Accesses the TodoListService Web API as a user`
- Keep **State** as **Enabled**
- Select **Add scope**
1. [Optional] In the list of pages, select **Manifest**
1. [Optional] Select the **Manifest** section
- in the manifest, search for **"accessTokenAcceptedVersion"**, and see that its value is **2**. This property lets Azure AD know that the Web API accepts v2.0 tokens
- Select **Save**

Expand All @@ -160,13 +160,13 @@ If you want to register your apps manually, as a first step you'll need to:
1. Select **New registration**.
1. When the **Register an application page** appears, enter your application's registration information:
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `TodoListClient-v2`.
- In the **Supported account types** section, select **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
- Change **Supported account types** to **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
- Select **Register** to create the application.
1. On the app **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the Visual Studio configuration file for this project (`ida:ClientId` in `TodoListClient\App.Config`).
1. In the list of pages for the app, select **Authentication**.
1. From the app's Overview page, select the **Authentication** section.
- In the **Redirect URLs** | **Suggested Redirect URLs for public clients (mobile, desktop)** section, check **urn:ietf:wg:oauth:2.0:oob**
- Select **Save**.
1. In the list of pages for the app, select **API permissions**
1. Select the **API permissions** section
- Click the **Add a permission** button and then,
- Ensure that the **My APIs** tab is selected
- In the list of APIs, select the `TodoListService-v2` API, or the name you entered for the Web API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If you want to use this automation:
- search for **signInAudience** and make sure it's set to **AzureADandPersonalMicrosoftAccount**
- Select **Save**
1. In the **Authentication** page for the *TodoListService-v2* application, check the `urn:ietf:wg:oauth:2.0:oob` reply URI so that the client can propose incremental consent to the user for the Web API when needed.
1. In the list of pages for the application registration of the *TodoListClient-v2* application, select **Manifest**
1. In tthe application registration page for the *TodoListClient-v2* application, select the **Manifest** section:
- search for **signInAudience** and make sure it's set to **AzureADandPersonalMicrosoftAccount**
- Select **Save**

Expand All @@ -119,7 +119,7 @@ These instructions only show the differences with the first part.
- When you press the **Add** button, the key value will be displayed, copy, and save the value in a safe location.
- You'll need this key later to configure the project in Visual Studio. This key value will not be displayed again, nor retrievable by any other means,
so record it as soon as it is visible from the Azure portal.
1. In the list of pages for the app, select **API permissions**
1. Select the **API permissions** section
- Click the **Add a permission** button and then,
- Ensure that the **Microsoft APIs** tab is selected
- In the *Commonly used Microsoft APIs* section, click on **Microsoft Graph**
Expand All @@ -129,7 +129,7 @@ These instructions only show the differences with the first part.
1. [Otherwise] If you have not granted admin consent to the Web API in the previous optional step, select **Authentication** in the list of pages and there:
- Check the `urn:ietf:wg:oauth:2.0:oob` Redirect URI checkbox. This is so that the client can propose incremental consent to the user for the downstream web apis used by our *TodoListService-v2* Web API.
- Select **Save**
1. [Optional] In the list of pages, select **Manifest**
1. [Optional] Select the **Manifest** section and:
- in the manifest, search for **"accessTokenAcceptedVersion"**, and see that its value is **2**. This property lets Azure AD know that the Web API accepts v2.0 tokens
- Select **Save**

Expand Down Expand Up @@ -160,7 +160,10 @@ Clean the solution, rebuild the solution, and run it

### Current limitations

- The on-behalf-of flow does not currently work for Microsoft Personal accounts.
The on-behalf-of flow works for Microsoft Personal accounts, but the consent is not yet rolled-up in the client for the user to consent to the Web API calling the downstream API (here Microsoft Graph). To make this work, the suggestion is:

- either to use the same client ID in the Client and the Service. This way the consent for the service will appear in the client.
- or to provide a protected page on the Web API (which therefore also becomes a Web app) so that the user can have an interaction

## How was the code created

Expand Down
12 changes: 6 additions & 6 deletions 2. Web API now calls Microsoft Graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ If you want to register your apps manually, as a first step you'll need to:
- When you press the **Add** button, the key value will be displayed, copy, and save the value in a safe location.
- You'll need this key later to configure the project in Visual Studio. This key value will not be displayed again, nor retrievable by any other means,
so record it as soon as it is visible from the Azure portal.
1. In the list of pages for the app, select **API permissions**
1. Select the **API permissions** section
- Click the **Add a permission** button and then,
- Ensure that the **Microsoft APIs** tab is selected
- In the *Commonly used Microsoft APIs* section, click on **Microsoft Graph**
- In the **Delegated permissions** section, ensure that the right permissions are checked: **User.Read**. Use the search box if necessary.
- Select the **Add permissions** button
- [Optional] if you are a tenant admin, and agree to grant the admin consent to the web api, select **Grant admin consent for {your tenant domain}**. If you don't do
it, users will be presented a consent screen enabling them to consent to using the web api.
1. In the list of pages for the app, select **Expose an API**
1. Select the **Expose an API** section, and:
- Select **Add a scope**
- accept the proposed Application ID URI (api://{clientId}) by selecting **Save and Continue**
- Enter the following parameters
Expand All @@ -171,7 +171,7 @@ If you want to register your apps manually, as a first step you'll need to:
- in **User consent description** type `Accesses the TodoListService Web API as a user`
- Keep **State** as **Enabled**
- Select **Add scope**
1. [Optional] In the list of pages, select **Manifest**
1. [Optional] Select the **Manifest** section and:
- in the manifest, search for **"accessTokenAcceptedVersion"**, and see that its value is **2**. This property lets Azure AD know that the Web API accepts v2.0 tokens
- Select **Save**

Expand All @@ -183,13 +183,13 @@ If you want to register your apps manually, as a first step you'll need to:
1. Select **New registration**.
1. When the **Register an application page** appears, enter your application's registration information:
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `TodoListClient-v2`.
- In the **Supported account types** section, select **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
- Change **Supported account types** to **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
- Select **Register** to create the application.
1. On the app **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the Visual Studio configuration file for this project (`ida:ClientId` in `TodoListClient\App.Config`).
1. In the list of pages for the app, select **Authentication**.
1. From the app's Overview page, select the **Authentication** section.
- In the **Redirect URLs** | **Suggested Redirect URLs for public clients (mobile, desktop)** section, check **urn:ietf:wg:oauth:2.0:oob**
- Select **Save**.
1. In the list of pages for the app, select **API permissions**
1. Select the **API permissions** section
- Click the **Add a permission** button and then,
- Ensure that the **My APIs** tab is selected
- In the list of APIs, select the API `TodoListService-v2`.
Expand Down

0 comments on commit 7f80732

Please sign in to comment.