Skip to content

Commit c818f25

Browse files
committed
Cleanup
1 parent 5a732f7 commit c818f25

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

src/Microsoft.Owin.Security.OpenIdConnect/OpenIdConnectAuthenticationOptions.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class OpenIdConnectAuthenticationOptions : AuthenticationOptions
2020
private OpenIdConnectProtocolValidator _protocolValidator;
2121
private TokenValidationParameters _tokenValidationParameters;
2222
private TimeSpan _backchannelTimeout;
23+
private ISecurityTokenValidator _securityTokenValidator;
2324

2425
/// <summary>
2526
/// Initializes a new <see cref="OpenIdConnectAuthenticationOptions"/>
@@ -242,7 +243,19 @@ public string SignInAsAuthenticationType
242243
/// <summary>
243244
/// Gets or sets the <see cref="ISecurityTokenValidator"/> used to validate identity tokens.
244245
/// </summary>
245-
public ISecurityTokenValidator SecurityTokenValidator { get; set; }
246+
public ISecurityTokenValidator SecurityTokenValidator
247+
{
248+
get { return _securityTokenValidator; }
249+
set
250+
{
251+
if (value == null)
252+
{
253+
throw new ArgumentNullException("value");
254+
}
255+
256+
_securityTokenValidator = value;
257+
}
258+
}
246259

247260
/// <summary>
248261
/// Gets or sets the TokenValidationParameters

src/Microsoft.Owin.Security.WsFederation/WsFederationAuthenticationHandler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ protected override async Task<AuthenticationTicket> AuthenticateCoreAsync()
309309
}
310310
}
311311

312-
// what to do here?
313312
if (principal == null)
314313
{
315314
throw new SecurityTokenException("no validator found");

src/Microsoft.Owin.Security.WsFederation/WsFederationAuthenticationMiddleware.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,6 @@ public WsFederationAuthenticationMiddleware(OwinMiddleware next, IAppBuilder app
5151
Options.StateDataFormat = new PropertiesDataFormat(dataProtector);
5252
}
5353

54-
if (Options.SecurityTokenHandlers == null)
55-
{
56-
Options.SecurityTokenHandlers = new Collection<ISecurityTokenValidator>
57-
{
58-
new Saml2SecurityTokenHandler(),
59-
// new SamlSecurityTokenHandler(),
60-
new JwtSecurityTokenHandler()
61-
};
62-
}
63-
6454
if (Options.Notifications == null)
6555
{
6656
Options.Notifications = new WsFederationAuthenticationNotifications();

src/Microsoft.Owin.Security.WsFederation/WsFederationAuthenticationOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class WsFederationAuthenticationOptions : AuthenticationOptions
2323
private ICollection<ISecurityTokenValidator> _securityTokenHandlers = new Collection<ISecurityTokenValidator>()
2424
{
2525
new Saml2SecurityTokenHandler(),
26-
// new SamlSecurityTokenHandler(),
26+
new SamlSecurityTokenHandler(),
2727
new JwtSecurityTokenHandler()
2828
};
2929
private TokenValidationParameters _tokenValidationParameters;

0 commit comments

Comments
 (0)