Skip to content

Commit dd2bfc0

Browse files
committed
Revert 2 files
1 parent 6053177 commit dd2bfc0

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

articles/active-directory/develop/howto-build-services-resilient-to-metadata-refresh.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ Use latest version of [Microsoft.IdentityModel.*](https://www.nuget.org/packages
3030
In the `ConfigureServices` method of the Startup.cs, ensure that `JwtBearerOptions.RefreshOnIssuerKeyNotFound` is set to true, and that you're using the latest Microsoft.IdentityModel.* library. This property should be enabled by default.
3131

3232
```csharp
33-
services.Configure<JwtBearerOptions>(AzureADDefaults.JwtBearerAuthenticationScheme, options =>
34-
{
35-
36-
// shouldn’t be necessary as it’s true by default
37-
options.RefreshOnIssuerKeyNotFound = true;
38-
39-
};
33+
services.Configure<JwtBearerOptions>(AzureADDefaults.JwtBearerAuthenticationScheme, options =>
34+
{
35+
36+
// shouldn’t be necessary as it’s true by default
37+
options.RefreshOnIssuerKeyNotFound = true;
38+
39+
};
4040
```
4141

4242
## ASP.NET/ OWIN
4343

44-
Microsoft recommends that you move to ASP.NET Core, as development has stopped on ASP.NET.
44+
Microsoft recommends that you move to ASP.NET Core, as development has stopped on ASP.NET.
4545

46-
If you're using ASP.NET classic, use the latest [`Microsoft.IdentityModel.*`](https://www.nuget.org/packages?q=Microsoft.IdentityModel).
46+
If you're using ASP.NET classic, use the latest [Microsoft.IdentityModel.*](https://www.nuget.org/packages?q=Microsoft.IdentityModel).
4747

4848
OWIN has an automatic 24-hour refresh interval for the `OpenIdConnectConfiguration`. This refresh will only be triggered if a request is received after the 24-hour time span has passed. As far as we know, there's no way to change this value or trigger a refresh early, aside from restarting the application.
4949

@@ -52,20 +52,18 @@ OWIN has an automatic 24-hour refresh interval for the `OpenIdConnectConfigurati
5252
If you validate your token yourself, for instance in an Azure Function, use the latest version of [Microsoft.IdentityModel.*](https://www.nuget.org/packages?q=Microsoft.IdentityModel) and follow the metadata guidance illustrated by the code snippets below.
5353
5454
```csharp
55-
var configManager =
56-
new ConfigurationManager<OpenIdConnectConfiguration>(
57-
"http://someaddress.com",
58-
new OpenIdConnectConfigurationRetriever());
59-
60-
var config = await configManager.GetConfigurationAsync().ConfigureAwait(false);
61-
var validationParameters = new TokenValidationParameters()
55+
ConfigurationManager<OpenIdConnectConfiguration> configManager =
56+
new ConfigurationManager<OpenIdConnectConfiguration>("http://someaddress.com",
57+
new OpenIdConnectConfigurationRetriever());
58+
OpenIdConnectConfiguration config = await configManager.GetConfigurationAsync().ConfigureAwait(false);
59+
TokenValidationParameters validationParameters = new TokenValidationParameters()
6260
{
6361
6462
IssuerSigningKeys = config.SigningKeys;
6563
6664
}
6765

68-
var tokenHandler = new JsonWebTokenHandler();
66+
JsonWebTokenHandler tokenHandler = new JsonWebTokenHandler();
6967
result = Handler.ValidateToken(jwtToken, validationParameters);
7068
if (result.Exception != null && result.Exception is SecurityTokenSignatureKeyNotFoundException)
7169
{
@@ -77,12 +75,11 @@ if (result.Exception != null && result.Exception is SecurityTokenSignatureKeyNot
7775
IssuerSigningKeys = config.SigningKeys,
7876
7977
};
80-
8178
// attempt to validate token again after refresh
8279
result = Handler.ValidateToken(jwtToken, validationParameters);
8380
}
8481
```
8582

86-
## Next steps
83+
## Next Steps
8784

8885
To learn more, see [token validation in a protected web API](scenario-protected-web-api-app-configuration.md#token-validation)

articles/cloud-services/security-baseline.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: cloud-services
66
ms.topic: conceptual
77
ms.date: 02/17/2021
88
ms.author: mbaldwin
9-
ms.custom: subject-security-benchmark, generated
9+
ms.custom: subject-security-benchmark
1010

1111
# Important: This content is machine generated; do not modify this topic directly. Contact mbaldwin for more information.
1212

0 commit comments

Comments
 (0)