Skip to content

Commit ac4df6f

Browse files
committed
Update all built-in AuthenticationSchemeOptions to initialize Events
1 parent 8883b98 commit ac4df6f

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/Security/Authentication/Certificate/src/CertificateAuthenticationOptions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ namespace Microsoft.AspNetCore.Authentication.Certificate;
1010
/// </summary>
1111
public class CertificateAuthenticationOptions : AuthenticationSchemeOptions
1212
{
13+
/// <summary>
14+
/// Initializes a new instance of <see cref="CertificateAuthenticationOptions"/>.
15+
/// </summary>
16+
public CertificateAuthenticationOptions()
17+
{
18+
Events = new CertificateAuthenticationEvents();
19+
}
20+
1321
/// <summary>
1422
/// Value indicating the types of certificates accepted by the authentication middleware.
1523
/// </summary>

src/Security/Authentication/JwtBearer/src/JwtBearerOptions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public JwtBearerOptions()
3232
SecurityTokenValidators = new List<ISecurityTokenValidator> { _defaultHandler };
3333
#pragma warning restore CS0618 // Type or member is obsolete
3434
TokenHandlers = new List<TokenHandler> { _defaultTokenHandler };
35+
Events = new JwtBearerEvents();
3536
}
3637

3738
/// <summary>

src/Security/Authentication/Negotiate/src/NegotiateOptions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate;
88
/// </summary>
99
public class NegotiateOptions : AuthenticationSchemeOptions
1010
{
11+
/// <summary>
12+
/// Initializes a new instance of <see cref="NegotiateOptions"/>.
13+
/// </summary>
14+
public NegotiateOptions()
15+
{
16+
Events = new NegotiateEvents();
17+
}
18+
1119
/// <summary>
1220
/// The object provided by the application to process events raised by the negotiate authentication handler.
1321
/// The application may use the existing NegotiateEvents instance and assign delegates only to the events it

0 commit comments

Comments
 (0)