Permalink
Browse files

made openid endpoint customizable to work with other providers

  • Loading branch information...
1 parent 9a1eb56 commit e18f91668220b7edc710b00c84149f1b9132ba2d @dustinwhittle dustinwhittle committed with Yahoo! Oct 13, 2009
Showing with 5 additions and 11 deletions.
  1. +5 −11 lib/Yahoo/YahooOAuthApplication.class.php
@@ -62,7 +62,7 @@ public function __construct($consumer_key, $consumer_secret, $application_id, $c
$this->signature_method_hmac_sha1 = new OAuthSignatureMethod_HMAC_SHA1();
}
- public function getOpenIDUrl($return_to = false, $lang = 'en')
+ public function getOpenIDUrl($return_to = false, $lang = 'en', $openIdEndpoint = 'https://open.login.yahooapis.com/openid/op/auth')
{
$openid_request = array(
'openid.ns' => 'http://specs.openid.net/auth/2.0',
@@ -90,13 +90,7 @@ public function getOpenIDUrl($return_to = false, $lang = 'en')
'xopenid_lang_pref' => $lang,
);
- return 'https://open.login.yahooapis.com/openid/op/auth?'.http_build_query($openid_request);
- }
-
-
- public function validateOpenID()
- {
-
+ return $openIdEndpoint.'?'.http_build_query($openid_request);
}
public function getRequestToken($callback = "oob")
@@ -273,7 +267,7 @@ public function getContact($guid = NULL, $cid)
{
$guid = $this->token->yahoo_guid;
}
-
+
$url = sprintf(YahooOAuthClient::SOCIAL_API_URL.'/user/%s/contact/%s', $guid, $cid);
$parameters = array('format' => 'json');
@@ -309,7 +303,7 @@ public function syncContacts($guid = null, $contactsync)
{
$guid = $this->token->yahoo_guid;
}
-
+
$url = sprintf(YahooOAuthClient::SOCIAL_API_URL.'/user/%s/contacts', $guid);
$parameters = array('format' => 'json');
@@ -323,7 +317,7 @@ public function syncContacts($guid = null, $contactsync)
return $http['response_body'];
}
-
+
public function addContact($guid, $contact)
{
if($guid == null && !is_null($this->token))

0 comments on commit e18f916

Please sign in to comment.