Share via


IExchangeClient::SetCredentials (Windows Embedded CE 6.0)

1/6/2010

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.

Syntax

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 Value

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 Embedded 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 privileged 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

Header iexchangeclient.h, iexchangeclient.idl
Library OWAExchangeClient.lib
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

IExchangeClient
IExchangeClient::Initialize