CoSetProxyBlanket
Sets the
authentication information that will be used to make calls on the specified
proxy.
HRESULT CoSetProxyBlanket(
void
* pProxy, |
//Indicates the proxy to set |
DWORD dwAuthnSvc, |
//Authentication service to use |
DWORD dwAuthzSvc, |
//Authorization
service to use |
WCHAR * pServerPrincName, |
//The server principal name to use with the
authentication service |
DWORD dwAuthnLevel, |
//The authentication level to use |
DWORD dwImpLevel, |
//The impersonation level to use |
RPC_AUTH_IDENTITY_HANDLE
* pAuthInfo, |
//The identity of the client |
DWORD dwCapabilities |
//Undefined capability flags |
); |
|
Parameter
pProxy
[in] Pointer
to an interface on the proxy for which this authentication information is to be
set.
dwAuthnSvc
[in] A single
DWORD value from the list of RPC_C_AUTHN_xxx
dwAuthzSvc
[in] A single
DWORD value from the list of RPC_C_AUTHZ_xxx
pServerPrincName
[in] Points
to a WCHAR string that indicates the server principal name to use with the
authentication service. If you are using RPC_C_AUTHN_WINNT, the principal name
must be NULL.
dwAuthnLevel
[in] A single
DWORD value from the list of RPC_C_AUTHN_LEVEL_xxx
dwImpLevel
[in] A single
DWORD value from the list of RPC_C_IMP_LEVEL_xxx
pAuthInfo
[in]
Establishes the identity of the client. It is authentication service specific.
Some authentication services allow the application to pass in a different user
name and password. COM keeps a pointer to the memory passed in until COM is
uninitialized or a new value is set. If NULL is specified COM uses the current
identity (the process token). For NTLMSSP the structure is
SEC_WINNT_AUTH_IDENTITY_W.
dwCapabilities
[in] Flags to
establish indicating the further capabilities of this proxy. Currently, no
capability flags are defined.
The caller
should specify EOAC_NONE. EOAC_MUTUAL_AUTH is defined and may be used by other
security providers, but is not supported by NTLMSSP. Thus, NTLMSSP will accept
this flag without generating an error but without providing mutual
authentication.
Return Values
S_OK
Success,
append the headers.
E_INVALIDARG
One or more
arguments is invalid.
Remarks
Sets the
authentication information that will be used to make calls on the specified
proxy. This function encapsulates the following sequence of common calls (error
handling excluded):
pProxy->QueryInterface(IID_IClientSecurity, (void**)&pcs);
pcs->SetBlanket(pProxy, dwAuthnSvc, dwAuthzSvc, pServerPrincName,
dwAuthnLevel, dwImpLevel,
pAuthInfo, dwCapabilities);
pcs->Release();
See Also