Overview

Namespaces

  • cli_db
    • propel
      • map
      • om
  • cli_import
  • LoggedPDO
  • None
  • PHP
  • webservices
    • cart
    • combisearch
    • details
      • annotations
        • feature
    • graphs
      • barplot
      • genome
    • listing
    • queue

Classes

  • Console_CommandLine_Action_ExtendedHelp
  • LightOpenID
  • Log_firebugJSON
  • WebService

Interfaces

  • CLI_Command

Functions

  • acquire_database
  • cli_error_handler
  • connect_queue_db
  • create_job
  • display_feature
  • display_feature_by_id
  • display_isoform_by_id
  • display_unigene_by_id
  • download
  • execute_command
  • execute_job
  • execute_query_dir
  • get_db_connection
  • get_job_results
  • get_program_databases
  • myErrorHandler
  • pdo_connect
  • report_results_cleanup
  • requestVal
  • smarty_function_call_webservice
  • smarty_function_dbxreflink
  • smarty_function_interprolink
  • smarty_function_publink
  • smarty_modifier_clean_id
  • split_fasta
  • unzip
  • Overview
  • Namespace
  • Class
  • Tree

Class LightOpenID

This class provides a simple interface for OpenID (1.1 and 2.0) authentication. Supports Yadis discovery. The authentication process is stateless/dumb.

Usage: Sign-on with OpenID is a two step process: Step one is authentication with the provider:

$openid = new LightOpenID('my-host.example.org');
$openid->identity = 'ID supplied by user';
header('Location: ' . $openid->authUrl());

The provider then sends various parameters via GET, one of them is openid_mode. Step two is verification:

$openid = new LightOpenID('my-host.example.org');
if ($openid->mode) {
    echo $openid->validate() ? 'Logged in.' : 'Failed';
}

Change the 'my-host.example.org' to your domain name. Do NOT use $_SERVER['HTTP_HOST'] for that, unless you know what you are doing.

Optionally, you can set $returnUrl and $realm (or $trustRoot, which is an alias). The default values for those are: $openid->realm = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; $openid->returnUrl = $openid->realm . $_SERVER['REQUEST_URI']; If you don't know their meaning, refer to any openid tutorial, or specification. Or just guess.

AX and SREG extensions are supported. To use them, specify $openid->required and/or $openid->optional before calling $openid->authUrl(). These are arrays, with values being AX schema paths (the 'path' part of the URL). For example: $openid->required = array('namePerson/friendly', 'contact/email'); $openid->optional = array('namePerson/first'); If the server supports only SREG or OpenID 1.1, these are automaticaly mapped to SREG names, so that user doesn't have to know anything about the server.

To get the values, use $openid->getAttributes().

The library requires PHP >= 5.1.2 with curl or http/https stream wrappers enabled.

Copyright: Copyright (c) 2010, Mewp
License: MIT
Author: Mewp
Located at src/web/includes/lightopenid/openid.php
Methods summary
public
# __construct( mixed $host )
public
# __set( mixed $name, mixed $value )
public
# __get( mixed $name )
public true,
# hostExists( mixed $url )

Checks if the server specified in the url exists.

Checks if the server specified in the url exists.

Parameters

$url
mixed
$url url to check

Returns

true,
if the server exists; false otherwise
protected
# request_curl( mixed $url, mixed $method = 'GET', mixed $params = array(), mixed $update_claimed_id )
protected
# parse_header_array( mixed $array, mixed $update_claimed_id )
protected
# request_streams( mixed $url, mixed $method = 'GET', mixed $params = array(), mixed $update_claimed_id )
protected
# request( mixed $url, mixed $method = 'GET', mixed $params = array(), mixed $update_claimed_id = false )
protected
# build_url( mixed $url, mixed $parts )
protected
# htmlTag( mixed $content, mixed $tag, mixed $attrName, mixed $attrValue, mixed $valueName )

Helper function used to scan for <meta>/<link> tags and extract information from them

Helper function used to scan for <meta>/<link> tags and extract information from them

public String
# discover( mixed $url )

Performs Yadis and HTML discovery. Normally not used.

Performs Yadis and HTML discovery. Normally not used.

Parameters

$url
mixed
$url Identity URL.

Returns

String
OP Endpoint (i.e. OpenID provider address).

Throws

ErrorException
protected
# sregParams( )
protected
# axParams( )
protected
# authUrl_v1( mixed $immediate )
protected
# authUrl_v2( mixed $immediate )
public String
# authUrl( String $immediate = false )

Returns authentication url. Usually, you want to redirect your user to it.

Returns authentication url. Usually, you want to redirect your user to it.

Parameters

$immediate
String
$select_identifier Whether to request OP to select identity for an user in OpenID 2. Does not affect OpenID 1.

Returns

String
The authentication url.

Throws

ErrorException
public Bool
# validate( )

Performs OpenID verification with the OP.

Performs OpenID verification with the OP.

Returns

Bool
Whether the verification was successful.

Throws

ErrorException
protected
# getAxAttributes( )
protected
# getSregAttributes( )
public
# getAttributes( )

Gets AX/SREG attributes provided by OP. should be used only after successful validaton. Note that it does not guarantee that any of the required/optional parameters will be present, or that there will be no other attributes besides those specified. In other words. OP may provide whatever information it wants to.
* SREG names will be mapped to AX names.
* @return Array Array of attributes with keys being the AX schema names, e.g. 'contact/email'

Gets AX/SREG attributes provided by OP. should be used only after successful validaton. Note that it does not guarantee that any of the required/optional parameters will be present, or that there will be no other attributes besides those specified. In other words. OP may provide whatever information it wants to. * SREG names will be mapped to AX names. * @return Array Array of attributes with keys being the AX schema names, e.g. 'contact/email'

See

http://www.axschema.org/types/
Properties summary
public mixed $returnUrl
#
public array $required array()
#
public array $optional array()
#
public mixed $verify_peer null
#
public mixed $capath null
#
public mixed $cainfo null
#
public mixed $data
#
protected mixed $server
#
protected mixed $version
#
protected mixed $trustRoot
#
protected mixed $aliases
#
protected boolean $identifier_select false
#
protected boolean $ax false
#
protected boolean $sreg false
#
protected mixed $setup_url null
#
protected array $headers array()
#
protected static array $ax_to_sreg array( 'namePerson/friendly' => 'nickname', 'contact/email' => 'email', 'namePerson' => 'fullname', 'birthDate' => 'dob', 'person/gender' => 'gender', 'contact/postalCode/home' => 'postcode', 'contact/country/home' => 'country', 'pref/language' => 'language', 'pref/timezone' => 'timezone', )
#
tbro API documentation generated by ApiGen 2.8.0