File: Windows.Win32.HTTP_REQUEST_AUTH_INFO.g.cs
Project: src\src\Servers\HttpSys\src\Microsoft.AspNetCore.Server.HttpSys.csproj (Microsoft.AspNetCore.Server.HttpSys)
// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using global::System.Runtime.Versioning;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{
	namespace Networking.HttpServer
	{
		/// <summary>Contains the authentication status of the request with a handle to the client token that the receiving process can use to impersonate the authenticated client.</summary>
		/// <remarks>
		/// <para>Starting with HTTP version 2.0, the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/aa364545(v=vs.85)">HTTP_REQUEST</a> structure  contains an <a href="https://docs.microsoft.com/windows/desktop/api/http/ns-http-http_request_info">HTTP_REQUEST_INFO</a> structure. The <b>pVoid</b> member of the <b>HTTP_REQUEST_INFO</b> structure points to the <b>HTTP_REQUEST_AUTH_INFO</b> when the request information type is <b>HttpRequestInfoTypeAuth</b>. When the application receives a request with this structure and the request has not been authenticated, it can send the initial 401 challenge with the desired set of WWW-Authenticate headers in the <a href="https://docs.microsoft.com/windows/desktop/api/http/ns-http-http_multiple_known_headers">HTTP_MULTIPLE_KNOWN_HEADERS</a> structure. When the HTTP Server API completes  the authentication handshake, it fills  the <b>HTTP_REQUEST_AUTH_INFO</b> structure and passes it to the application with the request again. The handle to the access token that represents the client identity is provided in this structure by the HTTP Server API. Context Attributes The <b>ContextAttributes</b> member is provided for SSPI based schemes. For example, SSPI applications can determine whether <b>ASC_RET_MUTUAL_AUTH</b> is set for a mutually authenticated session. The HTTP Server API does not provide the expiration time for the context in the <b>PackedContext</b> member. Applications may require the expiration time  in specific  circumstances, for example, when NTLM credential caching is enabled and the application queries for the expiration time for a cached context. If the server application requires the expiration time for the underlying client context associated with the access token, it can receive the packed context and call <a href="https://docs.microsoft.com/windows/desktop/api/sspi/nf-sspi-querycontextattributesa">QueryContextAttributes</a> with the  <b>SECPKG_ATTR_LIFESPAN</b>. Mutual Authentication Data By default, the HTTP Server API ensures that the mutual authentication data is added to the final 200 response; in general, server applications are not responsible for sending the mutual authentication data. However, applications can receive the mutual authentication data and send it with the final response. When the <b>ReceiveMutualAuth</b> member of the <a href="https://docs.microsoft.com/windows/desktop/api/http/ns-http-http_server_authentication_info">HTTP_SERVER_AUTHENTICATION_INFO</a> structure is set to true, applications receive the server credentials for mutual authentication along with the authenticated request. The mutual authentication data provided in the <b>pMutualAuthData</b> member contains the exact value of WWW-Authenticate header without the header name. For example, <b>pMutualAuthData</b> points to "Negotiate ade02938481eca". The application builds the WWW-Authenticate header by appending the provided <b>pMutualAuthData</b> as a response header value.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/http/ns-http-http_request_auth_info#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.46-beta+dd815b2b9b")]
		internal partial struct HTTP_REQUEST_AUTH_INFO
		{
			/// <summary>
			/// <para>A member of the <a href="https://docs.microsoft.com/windows/desktop/api/http/ne-http-http_auth_status">HTTP_AUTH_STATUS</a> enumeration that indicates the final authentication status of the request. If the authentication status is not <b>HttpAuthStatusSuccess</b>, applications should disregard members of this structure except <b>AuthStatus</b>, <b>SecStatus</b>, and <b>AuthType</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/http/ns-http-http_request_auth_info#members">Read more on docs.microsoft.com</see>.</para>
			/// </summary>
			internal winmdroot.Networking.HttpServer.HTTP_AUTH_STATUS AuthStatus;

			/// <summary>A <a href="https://docs.microsoft.com/windows/desktop/api/sspi/nf-sspi-acceptsecuritycontext">SECURITY_STATUS</a> value that indicates the security failure status when the <b>AuthStatus</b> member   is <b>HttpAuthStatusFailure</b>.</summary>
			internal winmdroot.Foundation.HRESULT SecStatus;

			/// <summary>
			/// <para>The authentication flags that indicate the following authentication attributes: </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/http/ns-http-http_request_auth_info#members">Read more on docs.microsoft.com</see>.</para>
			/// </summary>
			internal uint Flags;

			/// <summary>A member of the <a href="https://docs.microsoft.com/windows/desktop/api/http/ne-http-http_request_auth_type">HTTP_REQUEST_AUTH_TYPE</a> enumeration that indicates the authentication scheme attempted or established  for the request.</summary>
			internal winmdroot.Networking.HttpServer.HTTP_REQUEST_AUTH_TYPE AuthType;

			/// <summary>
			/// <para>A  handle to the client token that the receiving process can use to impersonate the authenticated client. The handle to the token should be closed by calling <a href="https://docs.microsoft.com/windows/desktop/api/handleapi/nf-handleapi-closehandle">CloseHandle</a> when it is no longer required. This token is valid only for the lifetime of the request. Applications can regenerate the initial 401 challenge to reauthenticate when the token expires.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/http/ns-http-http_request_auth_info#members">Read more on docs.microsoft.com</see>.</para>
			/// </summary>
			internal winmdroot.Foundation.HANDLE AccessToken;

			/// <summary>The client context attributes for the access token.</summary>
			internal uint ContextAttributes;

			/// <summary>The length, in bytes, of the <b>PackedContext</b>.</summary>
			internal uint PackedContextLength;

			/// <summary>The type of context in the <b>PackedContext</b> member.</summary>
			internal uint PackedContextType;

			/// <summary>
			/// <para>The security context for the authentication type. Applications can query the attributes of the packed context by calling the SSPI <a href="https://docs.microsoft.com/windows/desktop/api/sspi/nf-sspi-querycontextattributesa">QueryContextAttributes</a> API. However, applications must acquire a  credential handle for the security package for the indicated AuthType. Application should call the SSPI <a href="https://docs.microsoft.com/windows/desktop/api/sspi/nf-sspi-freecontextbuffer">FreeContextBuffer</a> API to free the serialized context when it is no longer required.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/http/ns-http-http_request_auth_info#members">Read more on docs.microsoft.com</see>.</para>
			/// </summary>
			internal unsafe void* PackedContext;

			/// <summary>The length, in bytes, of the <b>pMutualAuthData</b> member.</summary>
			internal uint MutualAuthDataLength;

			/// <summary>The Base64 encoded mutual authentication data used in  the WWW-Authenticate header.</summary>
			internal winmdroot.Foundation.PSTR pMutualAuthData;

			/// <summary></summary>
			internal ushort PackageNameLength;

			/// <summary></summary>
			internal winmdroot.Foundation.PWSTR pPackageName;
		}
	}
}