Skip to content
This repository was archived by the owner on Apr 12, 2023. It is now read-only.

Commit 9636515

Browse files
committed
Note about "Incremental and dynamic consent" in README
and syntax inconsistency fixes
1 parent f0ff3b6 commit 9636515

File tree

1 file changed

+38
-30
lines changed

1 file changed

+38
-30
lines changed

README.md

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The sample uses only delegate permissions, therefore it does not require admin c
1818
1919
## Using the Microsoft Graph Connect Sample
2020

21-
The screenshot below shows the app's start page.
21+
The screenshot below shows the app's start page.
2222

2323
![Microsoft Graph Connect Sample for ASP.NET Core 2.0 screenshot](readme-images/Page1.PNG)
2424

@@ -30,9 +30,9 @@ This library is suitable for use in a production environment. We provide the sam
3030

3131
To use the Microsoft Graph Connect Sample for ASP.NET Core 2.0, you need the following:
3232

33-
- Visual Studio 2017 [with .NET Core 2.0 SDK](https://www.microsoft.com/net/download/core) installed on your development computer.
34-
- Either a [personal Microsoft account](https://signup.live.com) or a [work or school account](https://dev.office.com/devprogram). (You don't need to be an administrator of the tenant.)
35-
- The application ID and key from the application that you [register on the App Registration Portal](#register-the-app).
33+
* Visual Studio 2017 [with .NET Core 2.0 SDK](https://www.microsoft.com/net/download/core) installed on your development computer.
34+
* Either a [personal Microsoft account](https://signup.live.com) or a [work or school account](https://dev.office.com/devprogram). (You don't need to be an administrator of the tenant.)
35+
* The application ID and key from the application that you [register on the App Registration Portal](#register-the-app).
3636

3737
## Register the app
3838

@@ -64,26 +64,28 @@ This app uses the Azure AD v2.0 endpoint, so you'll register it on the [App Regi
6464

6565
h. Click **Save**.
6666

67-
4. Configure Permissions for your application:
67+
>You'll use the application ID and secret to configure the app in Visual Studio.
68+
69+
4. Configure Permissions for your application. **(Optional)**
70+
71+
>Note that we are not required to add permissions for reading user data and sending emails during the app registration as you would do with the [v1 endpoint (ADAL)](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications). The [Incremental and dynamic consent](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-compare#incremental-and-dynamic-consent) capability of the v2 endpoint (MSAL) has made this step optional.
6872
6973
a. Choose **Microsoft Graph Permissions** > **Delegated Permissions** > **Add**.
7074

7175
b. Select **openid**, **email**, **profile**, **offline_access**, **User.Read**, **User.ReadBasic.All** and **Mail.Send**. Then click **Ok**.
7276

7377
c. Click **Save**.
7478

75-
You'll use the application ID and secret to configure the app in Visual Studio.
76-
7779
## Configure and run the sample
7880

7981
1. Download or clone the Microsoft Graph Connect Sample for ASP.NET Core.
8082

81-
2. Open the **MicrosoftGraphAspNetCoreConnectSample.sln** sample file in Visual Studio 2017.
83+
2. Open the **MicrosoftGraphAspNetCoreConnectSample.sln** sample file in Visual Studio 2017.
8284

8385
3. In Solution Explorer, open the **appsettings.json** file in the root directory of the project.
8486

8587
a. For the **AppId** key, replace `ENTER_YOUR_APP_ID` with the application ID of your registered application.
86-
88+
8789
b. For the **AppSecret** key, replace `ENTER_YOUR_SECRET` with the password of your registered application. Note that in production apps you should always use certificates as your application secrets, but for this sample we will use a simple shared secret password.
8890

8991
4. Press F5 to build and run the sample. This will restore NuGet package dependencies and open the app.
@@ -98,29 +100,34 @@ You'll use the application ID and secret to configure the app in Visual Studio.
98100

99101
8. Optionally edit the recipient list, and then choose the **Send email** button. When the mail is sent, a Success message is displayed on the top of the page.
100102

101-
## Key components of the sample
103+
## Key components of the sample
104+
102105
The following files contain code that's related to connecting to Microsoft Graph, loading user data and sending emails.
103106

104-
- [`appsettings.json`](MicrosoftGraphAspNetCoreConnectSample/appsettings.json) Contains values used for authentication and authorization.
105-
- [`Startup.cs`](MicrosoftGraphAspNetCoreConnectSample/Startup.cs) Configures the app and the services it uses, including authentication.
107+
* [`appsettings.json`](MicrosoftGraphAspNetCoreConnectSample/appsettings.json) Contains values used for authentication and authorization.
108+
* [`Startup.cs`](MicrosoftGraphAspNetCoreConnectSample/Startup.cs) Configures the app and the services it uses, including authentication.
106109

107-
**Controllers**
108-
- [`AccountController.cs`](MicrosoftGraphAspNetCoreConnectSample/Controllers/AccountController.cs) Handles sign in and sign out.
109-
- [`HomeController.cs`](MicrosoftGraphAspNetCoreConnectSample/Controllers/HomeController.cs) Handles the requests from the UI.
110+
### Controllers
110111

111-
**Views**
112-
- [`Index.cshtml`](MicrosoftGraphAspNetCoreConnectSample/Views/Home/Index.cshtml) Contains the sample's UI.
112+
* [`AccountController.cs`](MicrosoftGraphAspNetCoreConnectSample/Controllers/AccountController.cs) Handles sign in and sign out.
113+
* [`HomeController.cs`](MicrosoftGraphAspNetCoreConnectSample/Controllers/HomeController.cs) Handles the requests from the UI.
113114

114-
**Helpers**
115-
- [`GraphAuthProvider.cs`](MicrosoftGraphAspNetCoreConnectSample/Helpers/GraphAuthProvider.cs) Gets an access token using MSAL's **AcquireTokenSilentAsync** method.
116-
- [`GraphSdkHelper.cs`](MicrosoftGraphAspNetCoreConnectSample/Helpers/GraphSDKHelper.cs) Initiates the SDK client used to interact with Microsoft Graph.
117-
- [`GraphService.cs`](MicrosoftGraphAspNetCoreConnectSample/Helpers/GraphService.cs) Contains methods that use the **GraphServiceClient** to build and send calls to the Microsoft Graph service and to process the response.
118-
- The **GetUserJson** action gets the user's profile by an email adress and converts it to JSON.
119-
- The **GetPictureBase64** action gets the user's profile picture and converts it to a base64 string.
120-
- The **SendEmail** action sends an email on behalf of the current user.
115+
### Views
121116

122-
**TokenStorage**
123-
- [`SessionTokenCache.cs`](MicrosoftGraphAspNetCoreConnectSample/Helpers/SessionTokenCache.cs) Sample implementation of an in-memory token cache. Production apps will typically use some method of persistent storage.
117+
* [`Index.cshtml`](MicrosoftGraphAspNetCoreConnectSample/Views/Home/Index.cshtml) Contains the sample's UI.
118+
119+
### Helpers
120+
121+
* [`GraphAuthProvider.cs`](MicrosoftGraphAspNetCoreConnectSample/Helpers/GraphAuthProvider.cs) Gets an access token using MSAL's **AcquireTokenSilentAsync** method.
122+
* [`GraphSdkHelper.cs`](MicrosoftGraphAspNetCoreConnectSample/Helpers/GraphSDKHelper.cs) Initiates the SDK client used to interact with Microsoft Graph.
123+
* [`GraphService.cs`](MicrosoftGraphAspNetCoreConnectSample/Helpers/GraphService.cs) Contains methods that use the **GraphServiceClient** to build and send calls to the Microsoft Graph service and to process the response.
124+
* The **GetUserJson** action gets the user's profile by an email adress and converts it to JSON.
125+
* The **GetPictureBase64** action gets the user's profile picture and converts it to a base64 string.
126+
* The **SendEmail** action sends an email on behalf of the current user.
127+
128+
### TokenStorage
129+
130+
* [`SessionTokenCache.cs`](MicrosoftGraphAspNetCoreConnectSample/Helpers/SessionTokenCache.cs) Sample implementation of an in-memory token cache. Production apps will typically use some method of persistent storage.
124131

125132
## Contributing
126133

@@ -138,10 +145,11 @@ You can suggest changes for Microsoft Graph on [UserVoice](https://officespdev.u
138145

139146
## Additional resources
140147

141-
- [Microsoft Graph documentation](https://developer.microsoft.com/graph)
142-
- [Other Microsoft Graph Connect samples](https://github.com/MicrosoftGraph?q=connect)
143-
- [Microsoft Graph Webhooks Sample for ASP.NET Core](https://github.com/microsoftgraph/aspnetcore-apponlytoken-webhooks-sample)
144-
- [Microsoft Graph Connect Sample for ASP.NET 4.6](https://github.com/microsoftgraph/aspnet-connect-sample)
148+
* [Microsoft Graph documentation](https://developer.microsoft.com/graph)
149+
* [Other Microsoft Graph Connect samples](https://github.com/MicrosoftGraph?q=connect)
150+
* [Microsoft Graph Webhooks Sample for ASP.NET Core](https://github.com/microsoftgraph/aspnetcore-apponlytoken-webhooks-sample)
151+
* [Microsoft Graph Connect Sample for ASP.NET 4.6](https://github.com/microsoftgraph/aspnet-connect-sample)
145152

146153
## Copyright
154+
147155
Copyright (c) 2017 Microsoft. All rights reserved.

0 commit comments

Comments
 (0)