Get User Authorization (request_auth)

URL:

https://api.login.yahoo.com/oauth/v2/request_auth

Supported Methods:

GET, POST

After getting the Request Token from Yahoo!, your application presents to your Users a Yahoo! authorization page (OAuth Core 1.0 Spec, Section 6.2) asking them to give permission to your application to access their data.

The authorization page will only ask for permission to a limited amount of User data, based on the access scopes you specified during the initial registration process.

The following is an example of a authorization URL that includes the Request Token:

https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=j5nyp6

Table 4.3. Request Auth (request_auth) Request Parameters

Request Parameter Description
oauth_token The Request Token that Yahoo! returns as a response to the request_token call. The Request Token is required during the User authorization process.


The following parameters are appended to the callback URL, if one is provided in Step 2:

Table 4.4. Request Auth (request_auth) Callback URL Parameters

Callback URL Parameter Description
oauth_token The Request Token that Yahoo! returns as a response to the get_request_token call. It is appended to the authorization page URL. The Request Token is required during the User authorization process.
oauth_verifier The OAuth Verifier is a verification code tied to the Request Token. The OAuth Verifier and Request Token both must be provided in exchange for an Access Token. They also both expire together. If the oauth_callback is set to oob in Step 2, the OAuth Verifier is not included as a response parameter and is instead presented once the User grants authorization to your application. Yahoo! instructs the User to enter the OAuth Verifier code in your application. Your application must ask for this OAuth Verifier code to ensure OAuth authorization can proceed. The OAuth Verifier is intentionally short so that a User can type it manually.

Presenting the Yahoo! Authorization Page

You have two methods for presenting the Yahoo! authorization page:

  1. Present the Yahoo! authorization page through a browser pop-up window. (Preferred Method)

    When using the pop-up window method, you must follow these guidelines:

    • Your application must open a pop-up window to show the URL provided in xoauth_request_auth_url.
    • The pop-up must show the page URL. This is to ensure that Users know they are not being spoofed.
    • Once the User has authorized access and Yahoo! redirects the pop-up window to the URL specified in oauth_callback, passing the OAuth Verifier (oauth_verifier).
    • After Yahoo! performs the redirect within the pop-up window, your application must exchange the OAuth Verifer along with the Request Token for an Access Token.
    • Once you have received an Access Token from Yahoo!, you must close the pop-up window.

    The following example uses the Yahoo! Social API PHP SDK to open a pop-up window, listen for an authorization, close the popup, and refresh the originating page:

  2. Redirect from your Web application off-site to the Yahoo! authorization page.

    With this method, you must directs Users off-site to the Yahoo authorization page as indicated in xoauth_request_auth_url. Once the User authorizes access, Yahoo! redirects Users to the URL as indicated in oauth_callback.

    Note

    Because the Yahoo! authorization page is meant to be shown as a pop-up window, it will appear centered and constrained within a full browser window.

Important

If your application does not have access to a browser, it must provide the User with the Yahoo! authorization page URL and Request Token, both provided in Step 2. Your application must provide directions for your User to manually browser to the URL and enter the provided Request Token.

Table of Contents