<?php require_once 'M2b/Auth/OpenID/Message.php'; require_once 'M2b/Auth/OpenID/Extension.php'; require_once 'M2b/OAuth/OAuth.php'; define('Auth_OpenID_OAUTH_NS_URI', 'http://specs.openid.net/extensions/oauth/1.0'); Auth_OpenID_registerNamespaceAlias(Auth_OpenID_OAUTH_NS_URI, 'oauth'); /** * An object to hold the state of a oauth request. * * required: A list of the required fields in this simple registration * request * * optional: A list of the optional fields in this simple registration * request * * @package OpenID */ class Auth_OpenID_OAuthRequest extends Auth_OpenID_Extension { public $ns_alias = 'oauth'; public $ns_uri = Auth_OpenID_OAUTH_NS_URI; public $scope; public $consumer; /** * Initialize an empty oauth request. */ function __construct($consumer, $scope=null)
if (!in_array($field_name, array_keys($Auth_OpenID_sreg_data_fields))) { return false; } return true; } // URI used in the wild for Yadis documents advertising simple // registration support define('Auth_OpenID_SREG_NS_URI_1_0', 'http://openid.net/sreg/1.0'); // URI in the draft specification for simple registration 1.1 // <http://openid.net/specs/openid-simple-registration-extension-1_1-01.html> define('Auth_OpenID_SREG_NS_URI_1_1', 'http://openid.net/extensions/sreg/1.1'); // This attribute will always hold the preferred URI to use when // adding sreg support to an XRDS file or in an OpenID namespace // declaration. define('Auth_OpenID_SREG_NS_URI', Auth_OpenID_SREG_NS_URI_1_1); Auth_OpenID_registerNamespaceAlias(Auth_OpenID_SREG_NS_URI_1_1, 'sreg'); /** * Does the given endpoint advertise support for simple * registration? * * $endpoint: The endpoint object as returned by OpenID discovery. * returns whether an sreg type was advertised by the endpoint */ function Auth_OpenID_supportsSReg(&$endpoint) { return $endpoint->usesExtension(Auth_OpenID_SREG_NS_URI_1_1) || $endpoint->usesExtension(Auth_OpenID_SREG_NS_URI_1_0); } /** * A base class for classes dealing with Simple Registration protocol * messages. *
*/ /** * Import message and extension internals. */ require_once 'Auth/OpenID/Message.php'; require_once 'Auth/OpenID/Extension.php'; // URI used in the wild for Yadis documents advertising support // <http://step2.googlecode.com/svn/spec/openid_oauth_extension/latest/openid_oauth_extension.html> define('HYBRID_OAUTH_NS_URI_DRAFT', 'http://specs.openid.net/extensions/oauth/1.0'); // This attribute will always hold the preferred URI to use when // adding sreg support to an XRDS file or in an OpenID namespace // declaration. define('HYBRID_OAUTH_NS_URI', HYBRID_OAUTH_NS_URI_DRAFT); // Prefered namespace alias used for hybrid OAuth. define('HYBRID_OAUTH_NS_ALIAS', 'oauth'); Auth_OpenID_registerNamespaceAlias(HYBRID_OAUTH_NS_URI, HYBRID_OAUTH_NS_ALIAS); /** * Does the given endpoint advertise support for simple * registration? * * $endpoint: The endpoint object as returned by OpenID discovery. * returns whether an sreg type was advertised by the endpoint */ function Auth_OpenID_supportsHybridOAuth(&$endpoint) { return $endpoint->usesExtension(HYBRID_OAUTH_NS_URI); } /** * A base class for classes dealing with Hybrid OAuth protocol * messages. */