Skip to content

Commit 6c3ce9e

Browse files
authored
Update README.md
1 parent a8abb7a commit 6c3ce9e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ docker compose up --wait
101101
"PublicKey": "PUBLIC_KEY",
102102
"Issuer": "https://localhost:8001",
103103
"Audience": "http://localhost:5010",
104+
"DataProtectionApplicationName": "microidp",
105+
"DataProtectionKeysPath": "./DataProtectionKeys",
104106
"CookieName": "SAME AS IDP .env Jwt__CookieName",
105107
"DataProtectionPurpose": "SAME AS IDP .env Jwt__DataProtectionPurpose"
106108
}
@@ -117,6 +119,11 @@ dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer
117119
### Add Authentication Middleware
118120

119121
```csharp
122+
123+
services.AddDataProtection()
124+
.PersistKeysToFileSystem(new DirectoryInfo(configuration["Jwt:DataProtectionKeysPath"] ?? ""))
125+
.SetApplicationName(configuration["Jwt:DataProtectionApplicationName"] ?? "");
126+
120127
var rsa = RSA.Create();
121128
rsa.ImportRSAPublicKey(Convert.FromBase64String(configuration["Jwt:PublicKey"] ?? ""), out _);
122129

0 commit comments

Comments
 (0)