To perform a login, the Yahoo Messenger IM SDK requires a valid Yahoo username and password. However, most client login screens will allow the client to perform an “invisible” login as well, as well as strategies for remembering the username and password (see the Guidelines chapter for more information on login screen requirements).
The following figure shows a sample login screen for a Java ME mobile client.
We will concentrate only on the username and password for this example. In order to login, the first step that must be performed is to obtain authentication credentials from the Yahoo Login servers. This can only be done using the Yahoo Direct OAuth API, which we will cover briefly here.
There are two API calls that are required to authenticate with the Yahoo Direct OAuth API. The first obtains a Pre-Authorized Request Token (PART), and requires your login username, password, and the OAuth Consumer Key (API Key) that was just generated through developer.yahoo.com.
The call looks like this:
The result of this call is a single value, the
This token is then used for a second request, which exchanges the PART for an OAuth access token. You can find out more information on the standard method getting an access token here.