Skip to content

Commit b9ac099

Browse files
author
Kalyan Krishna
committed
First draft
1 parent 20307e6 commit b9ac099

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ There are two projects in this sample. Each needs to be separately registered in
6666

6767
#### Navigate to the Application registration portal
6868

69-
Sign in in [apps.dev.microsoft.com/](apps.dev.microsoft.com/). From there, you can add converged applications
69+
Sign in to [application registration portal](apps.dev.microsoft.com/). From there, you can add converged applications.
7070

7171
#### Register the TodoListClient-v2 app
7272

@@ -87,7 +87,7 @@ Sign in in [apps.dev.microsoft.com/](apps.dev.microsoft.com/). From there, you c
8787
1. In the *Platforms* section, click on the **Add Platform** button and then on **Web API**
8888
1. Copy the scope proposed by default to access your web api as a user. It's in the form ``api://<Application ID>/access_as_user``
8989
1. In the *Web API platform*, in the *Pre-authorized applications* section click on **Add application**
90-
1. In the *application ID* field, paste the application ID of the client application as pasted from the registration
90+
1. In the *application ID* field, paste the application ID of the `TodoListClient-v2` application as pasted from the registration
9191
1. In the *Scope* field, click on the **Select** combo box and select the scope for this Web API `api://<Application ID>/access_as_user`
9292
1. Press the **Save** button at the bottom of the page.
9393

@@ -113,16 +113,16 @@ a GUID or domain name | users can only sign in with an account for a specific or
113113
#### Configure the TodoListService C# project
114114

115115
1. Open the solution in Visual Studio.
116-
1. In the TodoListService project, open the `appsettings.json` file.
117-
1. Find the `ClientId` property and replace the value with the Application ID (Client ID) property of the Service application, that you registered earlier.
116+
1. In the *TodoListService* project, open the `appsettings.json` file.
117+
1. Find the `ClientId` property and replace the value with the Application ID (Client ID) property of the *TodoListService-v2* application, that you registered earlier.
118118
1. [Optional] if you want to limit sign-in to users in your organization, also update
119119
- The `Domain` property, replacing the existing value with your AAD tenant domain, for example, contoso.onmicrosoft.com.
120120
- The `TenantId` property replacing the existing value with the Tenant ID.
121121

122122
#### Configure the TodoListClient C# project
123123

124124
1. In the TodoListClient project, open `App.config`.
125-
1. Find the app key `ida:ClientId` and replace the value with the ApplicationID (Client ID) for the TodoListClient-v2 app copied from the app registration page.
125+
1. Find the app key `ida:ClientId` and replace the value with the ApplicationID (Client ID) for the *TodoListClient-v2* app copied from the app registration page.
126126
1. Find the app key `todo:TodoListScope` and replace the value with the scope of the TodoListService-v2 application copied from the app registration (of the form ``api://<Application ID of service>/access_as_user``)
127127
1. [Optional] If you want your application to work only in your organization (only in your tenant) you'll also need to Find the app key `ida:Tenant` and replace the value with your AAD Tenant ID (GUID). Alternatively you can also use your AAD tenant Name (for example, contoso.onmicrosoft.com)
128128
1. [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.

TodoListClient/App.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- 'consumers' to sign-in only Microsoft personal accounts
1616
-->
1717
<add key="ida:Tenant" value="common" />
18-
<add key="ida:ClientId" value="[Enter the Application ID (Client ID) of your application from the portal, e.g. b3682cc7-8b30-4bd2-aaba-080c6bf0fd31]" />
18+
<add key="ida:ClientId" value="[Enter_client_ID_Of_TodoListClient-v2_from_Azure_Portal,_e.g._784d7a5a-4a49-4d1d-b328-5812070f366f]" />
1919

2020
<!--
2121
todo:TodoListScope is the scope of the Web API you want to call. This can be:
@@ -24,7 +24,7 @@
2424
- a scope corresponding to a V1 application (for instance <GUID>/user_impersonation, where <GUID> is the
2525
clientId of a V1 application, created in the https://portal.azure.com portal.
2626
-->
27-
<add key="todo:TodoListScope" value="[Enter the scope of the application, e.g. api://b3682cc7-8b30-4bd2-aaba-080c6bf0fd31/access_as_user]" />
27+
<add key="todo:TodoListScope" value="api://[Enter_client_ID_Of_TodoListService-v2_from_Azure_Portal,_e.g._2ec40e65-ba09-4853-bcde-bcb60029e596]/access_as_user" />
2828
<add key="todo:TodoListBaseAddress" value="https://localhost:44351/" />
2929
</appSettings>
3030
</configuration>

TodoListService/Extensions/AzureAdAuthenticationBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void Configure(string name, JwtBearerOptions options)
5050
/// <param name="securityToken">Received Security Token</param>
5151
/// <param name="validationParameters">Token Validation parameters</param>
5252
/// <remarks>The issuer is considered as valid if it has the same http scheme and authority as the
53-
/// authority from the configuration file, has a tenant Id, and optionnally v2.0 (this web api
53+
/// authority from the configuration file, has a tenant Id, and optionally v2.0 (this web api
5454
/// accepts both V1 and V2 tokens)</remarks>
5555
/// <returns>The <c>issuer</c> if it's valid, or otherwise <c>null</c></returns>
5656
private string ValidateIssuer(string issuer, SecurityToken securityToken, TokenValidationParameters validationParameters)

TodoListService/appsettings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"AzureAd": {
33
"Instance": "https://login.microsoftonline.com/",
4-
"ClientId": "11111111-1111-1111-11111111111111111",
4+
"ClientId": "[Enter_client_ID_Of_TodoListService-v2_from_Azure_Portal,_e.g._2ec40e65-ba09-4853-bcde-bcb60029e596]",
55

66
/*
77
The Domain and TenantId are only needed if you want to accept access tokens
88
from a sigle tenant (line of business app)
99
Otherwise you can leave them blank
1010
*/
1111
"Domain": "qualified.domain.name", // for instance contoso.onmicrosoft.com
12-
"TenantId": "common" // 'common' or 'organizations' or 'consumers'
13-
// or tenant ID like '22222222-2222-2222-2222-222222222222'
12+
"TenantId": "common" // 'common' or 'organizations' or 'consumers'
13+
// or enter Directory ID Of tenant, e.g.contoso.onmicrosoft.com from Azure Portal, e.g. 14c2f153-90a7-4689-9db7-9543bf084dad
1414
},
1515
"Logging": {
1616
"IncludeScopes": false,

0 commit comments

Comments
 (0)