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: articles/applied-ai-services/immersive-reader/how-to-cache-token.md
+31-6Lines changed: 31 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,19 +19,44 @@ This article demonstrates how to cache the authentication token in order to impr
19
19
20
20
## Using ASP.NET
21
21
22
-
Import the **Microsoft.IdentityModel.Clients.ActiveDirectory** NuGet package, which is used to acquire a token. Next, use the following code to acquire an `AuthenticationResult`, using the authentication values you got when you [created the Immersive Reader resource](./how-to-create-immersive-reader.md).
22
+
Import the **Microsoft.Identity.Client** NuGet package, which is used to acquire a token.
23
+
24
+
Create a confidential client application property.
Next, use the following code to acquire an `AuthenticationResult`, using the authentication values you got when you [created the Immersive Reader resource](./how-to-create-immersive-reader.md).
23
44
24
45
> [!IMPORTANT]
25
46
> The [Microsoft.IdentityModel.Clients.ActiveDirectory](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory) NuGet package and Azure AD Authentication Library (ADAL) have been deprecated. No new features have been added since June 30, 2020. We strongly encourage you to upgrade, see the [migration guide](../../active-directory/develop/msal-migration.md) for more details.
Copy file name to clipboardExpand all lines: articles/applied-ai-services/immersive-reader/includes/quickstarts/immersive-reader-client-library-csharp.md
+27-13Lines changed: 27 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,12 @@ In this quickstart, you build a web app from scratch and integrate Immersive Rea
20
20
## Prerequisites
21
21
22
22
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services)
23
-
*[Visual Studio 2019](https://visualstudio.microsoft.com/downloads)
23
+
*[Visual Studio 2022](https://visualstudio.microsoft.com/downloads)
24
24
* An Immersive Reader resource configured for Azure Active Directory authentication. Follow [these instructions](../../how-to-create-immersive-reader.md) to get set up. You will need some of the values created here when configuring the sample project properties. Save the output of your session into a text file for future reference.
25
25
26
26
## Create a web app project
27
27
28
-
Create a new project in Visual Studio, using the ASP.NET Core Web Application template with built-in Model-View-Controller, and ASP.NET Core 2.1. Name the project "QuickstartSampleWebApp".
28
+
Create a new project in Visual Studio, using the ASP.NET Core Web Application template with built-in Model-View-Controller, and ASP.NET Core 6. Name the project "QuickstartSampleWebApp".
@@ -48,25 +48,25 @@ Right-click on the project in the _Solution Explorer_ and choose **Manage User S
48
48
}
49
49
```
50
50
51
-
### Install Active Directory NuGet package
51
+
### Install Identity Client NuGet package
52
52
53
-
The following code uses objects from the **Microsoft.IdentityModel.Clients.ActiveDirectory** NuGet package so you'll need to add a reference to that package in your project.
53
+
The following code uses objects from the **Microsoft.Identity.Client** NuGet package so you'll need to add a reference to that package in your project.
54
54
55
55
> [!IMPORTANT]
56
56
> The [Microsoft.IdentityModel.Clients.ActiveDirectory](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory) NuGet package and Azure AD Authentication Library (ADAL) have been deprecated. No new features have been added since June 30, 2020. We strongly encourage you to upgrade, see the [migration guide](../../../../active-directory/develop/msal-migration.md) for more details.
57
57
58
58
Open the NuGet Package Manager Console from **Tools -> NuGet Package Manager -> Package Manager Console** and run the following command:
Now, we'll configure the controller to obtain the Azure AD values from _secrets.json_. At the top of the _HomeController_ class, after ```public class HomeController : Controller {```, add the following code.
privatereadonlystringClientSecret; // Azure AD Application Service Principal password
78
78
privatereadonlystringSubdomain; // Immersive Reader resource subdomain (resource 'Name' if the resource was created in the Azure portal, or 'CustomSubDomain' option if the resource was created with Azure CLI PowerShell. Check the Azure portal for the subdomain on the Endpoint in the resource Overview page, for example, 'https://[SUBDOMAIN].cognitiveservices.azure.com/')
0 commit comments