Class Veriplace_Client

Description

Low-level Veriplace client implementation in PHP.

Users of the Veriplace client will minimally require an OAuth consumer key and OAuth consumer secret representing their application. In addition, some (but not all) API functions will require an application-specific Access Token.

  • property-read: string $serverURI: The base URI of the Veriplace server.
  • property-read: string $serverDirectURI: The base URI of the Veriplace server for all direct machine-to-machine requests. This always uses an HTTP scheme for the production server at veriplace.com.
  • property-read: boolean $secure: True if the Veriplace client uses SSL whenever communicating directly with the Veriplace server. This is always true for the production server at veriplace.com.
  • property-read: string $protocol: The protocol version used by the Veriplace client. Must be one of the values defined by Veriplace_ProtocolVersion.
  • property-read: string $consumerKey: The OAuth consumer key for this application.
  • property-read: Veriplace_Token $applicationToken: The optional application-specific access token, which is required by some methods of the Veriplace_UserDiscoveryAPI.
  • property-read: Veriplace_UserDiscoveryAPI $userDiscoveryAPI: The API object for obtaining user identity.
  • property-read: Veriplace_GetLocationAPI $getLocationAPI: The API object for requesting user location.
  • property-read: Veriplace_PermissionAPI $permissionAPI: The API object for verifying or deleting permission tokens.
  • property-read: Veriplace_InvitationAPI $invitationAPI: The API object for initiating out-of-band opt-in invitations from Veriplace to end users.
  • property-read: Veriplace_CallbackFactory $callbackFactory: The object that will be used for constructing callback URIs.
  • property-read: Veriplace_Redirector $redirector: The object that will be used for sending redirects to the User Agent.
  • property-read: Veriplace_OAuthTokenStore $tokenStore: The object that will be used for short-term storage of request tokens and access tokens.
  • property-read: string $applicationInfoURI: The URI of this application's information page on the Veriplace website.
  • property-read: int $defaultTimeout: The maximum number of seconds the client will wait for the server to respond, if not otherwise specified per request.

Located in /Veriplace/Client.php (line 95)


	
			
Class Constant Summary
 ACCESS_TOKEN_PATH = "/api/accessToken"
 APPLICATION_INFO_PATH = "/application"
 LONG_TIMEOUT = "veriplace_long_timeout"
 REQUEST_TOKEN_PATH = "/api/requestToken"
 USER_AUTHORIZATION_PATH = "/api/userAuthorization"
Method Summary
 Veriplace_Client __construct (Veriplace_Configuration $config)
 string createExternalUserDiscoveryURI (string $callback, string &$requestTokenOut)
 Veriplace_Token getAccessToken ([ $requestTokenValue = null])
 array getAllParameters ()
 void getParameter ( $name)
 string getRequestToken ()
 boolean isCallback ()
Methods
Constructor __construct (line 131)

Constructs a client object with the specified properties.

  • throws: Veriplace_ConfigurationException if a property value is invalid or a required property is missing
  • access: public
Veriplace_Client __construct (Veriplace_Configuration $config)
createExternalUserDiscoveryURI (line 386)

Creates a URI that will tell the Veriplace server to initiate user discovery and then call your application (using the specified callback URI).

This method is intended for use in applications where the main business logic is not tied to a web front-end. By asking a user to visit this URI, you allow Veriplace to interact with the user. Your application needs a single externally accessible URI to receive the HTTP callback.

When you receive the callback, it will include a request token whose value is identical to the one returned by this method; in other words, that token associates a particular callback with the original call to CreateExternalUserDiscoveryURI that started that process. The callback code can then call getAccessToken to convert the request token to an access token, and then use the Veriplace_UserDiscoveryAPI to get the user identifier. (If using the Veriplace web framework, calling Veriplace::requireUser() takes care of both of those steps.)

Using this method requires OAuth 1.0 Rev A, which is now the default protocol version.

  • return: The URI that the user should visit.
  • access: public
string createExternalUserDiscoveryURI (string $callback, string &$requestTokenOut)
  • string $callback: The application's callback URI.
  • string &$requestTokenOut: Will be set to the request token if successful.
getAccessToken (line 333)

Returns an access token for an OAuth callback request.

  • return: A valid access token.
  • throws: Veriplace_InvalidCallbackException if the callback did not contain a request token
  • throws: Veriplace_TransportException if there was an I/O error
  • throws: Veriplace_OAuthException if the server denied the access request
  • access: public
Veriplace_Token getAccessToken ([ $requestTokenValue = null])
  • $requestTokenValue
getAllParameters (line 432)

Shortcut for getting all named request parameters as an array.

  • access: public
array getAllParameters ()
getParameter (line 423)

Shortcut for getting the value of a named request parameter, returning null if not found.

  • access: public
void getParameter ( $name)
  • $name
getRequestToken (line 316)

Returns the request token value from the OAuth callback request. This is

mainly useful if you are receiving a callback from a user discovery process that was previously started with createExternalUserDiscoveryURI(), and need to match the current callback to the previously stored token for a particular user.

  • return: A request token value (not including the token secret).
  • throws: Veriplace_InvalidCallbackException if the callback did not contain a token
  • access: public
string getRequestToken ()
isCallback (line 242)

Returns true if the current request is an OAuth callback.

  • access: public
boolean isCallback ()
Class Constants
ACCESS_TOKEN_PATH = "/api/accessToken" (line 118)
APPLICATION_INFO_PATH = "/application" (line 120)
LONG_TIMEOUT = "veriplace_long_timeout" (line 119)
PRETTY_USER_DISCOVERY_USER_AUTHORIZATION_PATH = "/api/user" (line 121)
REQUEST_TOKEN_PATH = "/api/requestToken" (line 116)
USER_AUTHORIZATION_PATH = "/api/userAuthorization" (line 117)

Documentation generated on Sun, 29 Aug 2010 04:08:36 -0700 by phpDocumentor 1.4.1