Skip to content

Commit 328366e

Browse files
committed
Updating the instructions to create the token cache database
(as the appsettings.json and the Startup.cs were inconsistent)
1 parent 475475f commit 328366e

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"dependencies": {
3+
"secrets1": {
4+
"type": "secrets"
5+
}
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"dependencies": {
3+
"secrets1": {
4+
"type": "secrets.user"
5+
}
6+
}
7+
}

2-WebApp-graph-user/2-2-TokenCache/Startup.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ public void ConfigureServices(IServiceCollection services)
4747
// NOTE : This is a one time use method. We advise using it in development environments to create the tables required to enable token caching.
4848
// For production deployments, preferably, generate the schema from the tables generated in dev environments and use it to create the necessary tables in production.
4949
/*
50-
dotnet tool install --global dotnet-sql-cache
51-
dotnet sql-cache create "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=MsalTokenCacheDatabase;Integrated Security=True;" dbo TokenCache
50+
* 1. For instance in Visual Studio, open the SQL Server Object explorer, then (localdb)\MSSQLLocalDB, then databases
51+
* 2. Right click on Databases and select "Add New database", and then choose the name of the database: 'MsalTokenCacheDatabase'
52+
* 3. In the console application run the 2 following commands:
53+
dotnet tool install --global dotnet-sql-cache
54+
dotnet sql-cache create "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=MsalTokenCacheDatabase;Integrated Security=True;" dbo TokenCache
5255
*/
5356

5457
services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)

0 commit comments

Comments
 (0)