@@ -31,7 +31,7 @@ protected AuthenticateResult() { }
31
31
/// <summary>
32
32
/// Additional state values for the authentication session.
33
33
/// </summary>
34
- public AuthenticationProperties Properties => Ticket ? . Properties ;
34
+ public AuthenticationProperties Properties { get ; protected set ; }
35
35
36
36
/// <summary>
37
37
/// Holds failure information from the authentication.
@@ -54,7 +54,7 @@ public static AuthenticateResult Success(AuthenticationTicket ticket)
54
54
{
55
55
throw new ArgumentNullException ( nameof ( ticket ) ) ;
56
56
}
57
- return new AuthenticateResult ( ) { Ticket = ticket } ;
57
+ return new AuthenticateResult ( ) { Ticket = ticket , Properties = ticket . Properties } ;
58
58
}
59
59
60
60
/// <summary>
@@ -79,11 +79,29 @@ public static AuthenticateResult Fail(Exception failure)
79
79
/// <summary>
80
80
/// Indicates that there was a failure during authentication.
81
81
/// </summary>
82
- /// <param name="failureMessage">The failure message.</param>
82
+ /// <param name="failure">The failure exception.</param>
83
+ /// <param name="properties">Additional state values for the authentication session.</param>
83
84
/// <returns>The result.</returns>
84
- public static AuthenticateResult Fail ( string failureMessage )
85
+ public static AuthenticateResult Fail ( Exception failure , AuthenticationProperties properties )
85
86
{
86
- return new AuthenticateResult ( ) { Failure = new Exception ( failureMessage ) } ;
87
+ return new AuthenticateResult ( ) { Failure = failure , Properties = properties } ;
87
88
}
89
+
90
+ /// <summary>
91
+ /// Indicates that there was a failure during authentication.
92
+ /// </summary>
93
+ /// <param name="failureMessage">The failure message.</param>
94
+ /// <returns>The result.</returns>
95
+ public static AuthenticateResult Fail ( string failureMessage )
96
+ => Fail ( new Exception ( failureMessage ) ) ;
97
+
98
+ /// <summary>
99
+ /// Indicates that there was a failure during authentication.
100
+ /// </summary>
101
+ /// <param name="failureMessage">The failure message.</param>
102
+ /// <param name="properties">Additional state values for the authentication session.</param>
103
+ /// <returns>The result.</returns>
104
+ public static AuthenticateResult Fail ( string failureMessage , AuthenticationProperties properties )
105
+ => Fail ( new Exception ( failureMessage ) , properties ) ;
88
106
}
89
107
}
0 commit comments