You are here: Photobucket API Help > Getting Started > End-User Authentication > Web Authentication

Web Authentication

Requirements

To implement End-User authentication, you must:

As well, End-Users must be able to accept cookies.

If you cannot meet these requirements, please contact Photobucket to request alternatives. Or, if you are a partner, you can use the Direct Authentication method.

Condensed Procedure

The following web authentication procedure is the condensed version.

Note: The web authentication procedure outlined here is the greatly preferred method of authenticating users.

  1. Get a Login Request token by an HTTP POST to http://api.photobucket.com/login/request.
  1. Direct the End-User to Login page at: http://photobucket.com/apilogin/login?oauth_token=<token>.
  1. End-User logs in.
  2. End-User authorizes your application.
  3. End-User is directed back to your application.
  1. Receive a "ready" response from Photobucket in the callback redirect: <callback>oauth_token=<token>&username=<user>&subdomain=<api###.photobucket.com>
  2. Get a User Access token by an HTTP POST to: http://api.photobucket.com/login/access?oauth_token=<token>&<oauth_parameters>

See the method Web User Login for details.

Procedure

End-User web authentication happens in essentially four parts, per OAuth Section 6

  1. Consumer gets a Request Token.
  2. Consumer directs End-User to User Login/Authorization site on Photobucket.
  3. Photobucket directs End-User back to Consumer, to notify that Login/Authorization is complete.
  4. Consumer gets a User Access Token by providing the now authorized Request Token.

Notes:

See the method Web User Login for details.

1. Consumer gets a Request token.

The Request Token is an unauthorized token that can only be used to request an access token after it has been authorized. See Requesting a Page Anonymously for details about the Request Token signing procedure.

The response from either of the preceding login requests contains an oauth_token (<token>) and an oauth_token_secret (<token_secret>), in the text format "oauth_token=<token>&oauth_token_secret=<token_secret>", as specified in the OAuth spec.

This token and token secret are used in the login and access requests. The response also contains next_step, which is the URL to the Login page for the user.

2. Consumer directs End-User to user login and authorization on Photobucket.

The End-User must be directed to Photobucket to continue the login process and authorize the request token. Typically, a Consumer site redirects the End-User to the Photobucket API Login and Authorization page at: http://photobucket.com/apilogin/login.

Requests to this page are NOT signed via the OAuth signature methods.

The Photobucket API Login and Authorization page requires the oauth_token parameter, and allows the extra parameter:

The redirect therefore is minimally:

http://photobucket.com/apilogin/login?oauth_token=<token>

Login Page

The End-User is presented an HTML web page that contains inputs for their login name and password, and a checkbox to remember their login between browser sessions. On submit:

Authorization Page

After successfully logging in, the End-User is presented with an HTML web page that has button option to "Accept" or "Deny" your application from accessing their account. On submit:

3. Photobucket directs End-User back to Consumer.

Callback

After the End-User has completed the authorization, the End-User is redirected to the Consumer via the pre-set callback URL. The callback URL is appended with these parameters:

The Consumer is expected to use the callback URL parameters to continue the login process.

Login Complete Page

If a callback URL was not set by the Consumer, an HTML page that states the process is complete is shown.

4. Consumer gets an authorized User Access token.

The User Access token is used for all other user-authorized requests. See Requesting a Page as a Logged-in User as that is the same signing procedure for getting an access token from a request token. Only the Get User Access token method takes both the Request token <token> and the Request token secret <token_secret>.

The response from either of these contains an oauth_token <token> and an oauth_token_secret <token_secret>, in the text format 'oauth_token=<token>&oauth_token_secret=<token_secret>' as specified in the OAuth spec.

This User Access token and User Access token secret are used in all subsequent requests requiring a user login.

The following addition information is supplied:

 

Published 25-June-10. See developer.photobucket.com for additional resources.