Skip to content

Clarify NegotiateAuthentication.IsAuthenticated post-failure behavior#12724

Open
liveans wants to merge 1 commit into
dotnet:mainfrom
liveans:liveans/fix-negotiateauth-isauthenticated-docs
Open

Clarify NegotiateAuthentication.IsAuthenticated post-failure behavior#12724
liveans wants to merge 1 commit into
dotnet:mainfrom
liveans:liveans/fix-negotiateauth-isauthenticated-docs

Conversation

@liveans
Copy link
Copy Markdown
Member

@liveans liveans commented Jun 8, 2026

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.

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>
Copilot AI review requested due to automatic review settings June 8, 2026 17:24
@liveans liveans requested a review from a team as a code owner June 8, 2026 17:24
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the .NET API reference documentation for System.Net.Security.NegotiateAuthentication.IsAuthenticated to clarify that it reflects completion of the authentication exchange, not necessarily successful authentication, and directs callers to use the NegotiateAuthenticationStatusCode from GetOutgoingBlob to determine success.

Changes:

  • Updated IsAuthenticated summary/value/remarks to describe completion semantics and how to determine actual success.
  • Adjusted TargetName remarks to avoid implying IsAuthenticated == true means authentication succeeded.


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.

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%2A>. The status is <xref:System.Net.Security.NegotiateAuthenticationStatusCode.Completed> on success; any other value indicates that authentication didn't complete successfully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants