Permalink
Fetching contributors…
Cannot retrieve contributors at this time
250 lines (104 sloc) 2.91 KB

OneID

OneID's API functions

  • Class name: OneID
  • Namespace: global

Methods

  • __construct()
    Creates a OneID object for your use
  • set_credentials()
    Assignes OneID API ID and Key to local variables
  • response()
    Reads in the PHP input, and calls OneID's validator service.
  • redirect()
    Generates the json structure required to redirect to a new page
  • success()
    Checks a web page's error codend returns true if there were no errors

__construct

Creates a OneID object for your use

__construct(string $api_id, string $api_key, string $server) : \OneID

Parameters

  • $api_id string - Your OneID API ID credentials

  • $api_key string - Your OneID API Key credential

  • $server string - Which OneID server environment you want to point to

Returns

  • \OneID - A OneID object

set_credentials

Assignes OneID API ID and Key to local variables

set_credentials(string $id, string $key) : void

Parameters

  • $id string - API ID credetial

  • $key string - API Key credential


response

Reads in the PHP input, and calls OneID's validator service.

response() : array

Returns

  • array - The incoming data from OneID, as well as any data the validator responded with

redirect

Generates the json structure required to redirect to a new page

redirect(string $page, array $response) : array

Parameters

  • $page string - the url of the web page to redirect to

  • $response array - contains any errors and error codes that occured on the OneID request

Returns

  • array -

success

Checks a web page's error codend returns true if there were no errors

success(array $response) : bool

Parameters

  • $response array - The data response from OneID's validator service

Returns

  • bool - Decides whether or not the OneID signatures validated

Constants

DEFAULT_ATTRIBUTES_REQUESTED

const DEFAULT_ATTRIBUTES_REQUESTED = "email[email] name[first_name] name[last_name]"

Properties

$oneid_servers

public string $oneid_servers
  • Visibility: public
  • This property is static.

$oneid_script

public string $oneid_script
  • Visibility: public
  • This property is static.

$oneid_api_id

private string $oneid_api_id
  • Visibility: private

$oneid_api_key

private string $oneid_api_key
  • Visibility: private

$oneid_server

private string $oneid_server
  • Visibility: private