Skip to content

Commit 7340c9a

Browse files
liveansCopilotCopilot
authored
Clarify NegotiateAuthentication.IsAuthenticated post-failure behavior (#12724)
* Clarify NegotiateAuthentication.IsAuthenticated post-failure behavior The IsAuthenticated property returns true after the authentication exchange has finished, including in many post-negotiation failure cases (verified across the Windows, Unix, and ManagedSpnego PAL implementations in dotnet/runtime). The previous summary (successfully completed and the session was established) implied that a true value means successful authentication, which is misleading. Update the summary, value, and remarks to clarify that callers must inspect the NegotiateAuthenticationStatusCode returned by GetOutgoingBlob to determine actual success. Also remove a misleading `(see IsAuthenticated)` reference on TargetName that reinforced the same misconception. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 65991f8 commit 7340c9a

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

xml/System.Net.Security/NegotiateAuthentication.xml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,19 @@ When <xref:System.Net.Security.NegotiateAuthenticationStatusCode.ContinueNeeded>
287287
<ReturnType>System.Boolean</ReturnType>
288288
</ReturnValue>
289289
<Docs>
290-
<summary>Gets a value that indicates whether authentication was successfully completed and the session was established.</summary>
291-
<value>To be added.</value>
292-
<remarks>To be added.</remarks>
290+
<summary>Gets a value that indicates whether the authentication exchange has completed.</summary>
291+
<value><see langword="true" /> if the authentication exchange has completed; otherwise, <see langword="false" />.</value>
292+
<remarks>
293+
<format type="text/markdown"><![CDATA[
294+
295+
## Remarks
296+
297+
This property indicates whether the authentication exchange has completed, not whether authentication succeeded. A `true` value can be returned after either successful authentication or a terminal authentication failure.
298+
299+
To determine whether authentication actually succeeded, inspect the <xref:System.Net.Security.NegotiateAuthenticationStatusCode> returned by the most recent call to <xref:System.Net.Security.NegotiateAuthentication.GetOutgoingBlob*>. The status is <xref:System.Net.Security.NegotiateAuthenticationStatusCode.Completed> on success; any other value indicates that authentication didn't complete successfully.
300+
301+
]]></format>
302+
</remarks>
293303
</Docs>
294304
</Member>
295305
<Member MemberName="IsEncrypted">
@@ -544,7 +554,7 @@ The negotiated level of protection is only available when the session
544554
## Remarks
545555
546556
For the server side of the authentication, the property returns the target name
547-
specified by the client after successful authentication (see <xref:System.Net.Security.NegotiateAuthentication.IsAuthenticated>).
557+
specified by the client after authentication completes successfully.
548558
549559
For the client side of the authentication, the property returns the target name
550560
specified in <xref:System.Net.Security.NegotiateAuthenticationClientOptions.TargetName>.

0 commit comments

Comments
 (0)