Compartilhar via


IExchangeClient::SetCredentials (Windows CE 5.0)

Send Feedback

This method sets the credentials used in future requests.

If this method has been called previously to provide credentials, currently executing requests are cancelled and must be resubmitted.

HRESULT SetCredentials(  const WCHAR* c_wszUsername,  const WCHAR* c_wszPassword);

Parameters

  • c_wszUsername
    [in] Pointer to a null-terminated string that contains the username and, optionally, domain, to be used in future requests.

    To supply a domain, provide the domain first and the username second, separated by a backslash ("\").

    For example, to specify the domain "MYDOMAIN" and the username "myuser" this parameter should contain the string "MYDOMAIN\myuser".

    If no backslash exists, the entire string is assumed to be a username.

  • c_wszPassword
    [in] Pointer to a null-terminated string that contains the password to be used in future requests.

Return Values

The following table shows possible return values:

Value Description
E_POINTER The addresses of c_wszUsername or c_wszPassword do not point to valid strings.
OWAEC_E_NOTINITIALIZED This instance of the Exchange client has not been initialized.

It must be initialized using the IExchangeClient::Initialize method.

S_OK The credentials were stored successfully. Currently executing or pending requests were cancelled.

Remarks

The Exchange Client uses the Windows CE Credential Manager to maintain credentials it uses to connect to an Exchange server.

Note   Direct access to Credential Manager functionality is available only to OEMs. For more information about the Credential Manager, see Credential Manager.

The implementation of this method sets the provided user and password as both the Credential Manager default domain credentials (using CRED_TYPE_DOMAIN_PASSWORD) and default plaintext credentials (using CRED_TYPE_PLAINTEXT_PASSWORD).

The Exchange Client uses the domain credentials when interacting with an Outlook Web Access (OWA) server on an internal network, using a non-SSL (http://) URL.

The Exchange Client uses plaintext credentials when interacting with an OWA server over a network like the Internet. In this case, to protect the password, the Exchange Client can only connect over an SSL connection (one that uses an https:// URL).

The Exchange Client requires that both of these credential types be set for correct operation. However, it does not require that you call this method to set these credentials. You or another application can set them using the Credential Manager CredWrite function (available to OEMs only).

Only trusted applications should have access to Credential Manager functionality, and therefore to any credential information. For more information about using Credential Manager functionality with the Exchange Client, see Exchange Client Security.

This method does not validate the credentials using Kerberos or NTLM.

An application is responsible for validating the credentials before calling this method.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: IExchangeClient.h, IExchangeClient.idl.
Link Library: OWAExchangeClient.lib.

See Also

IExchangeClient | IExchangeClient::Initialize

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.