Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Commit

Permalink
made openid endpoint customizable to work with other providers
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinwhittle authored and Yahoo! committed Oct 13, 2009
1 parent 9a1eb56 commit e18f916
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions lib/Yahoo/YahooOAuthApplication.class.php
Expand Up @@ -62,7 +62,7 @@ public function __construct($consumer_key, $consumer_secret, $application_id, $c
$this->signature_method_hmac_sha1 = new OAuthSignatureMethod_HMAC_SHA1(); $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_request = array(
'openid.ns' => 'http://specs.openid.net/auth/2.0', 'openid.ns' => 'http://specs.openid.net/auth/2.0',
Expand Down Expand Up @@ -90,13 +90,7 @@ public function getOpenIDUrl($return_to = false, $lang = 'en')
'xopenid_lang_pref' => $lang, 'xopenid_lang_pref' => $lang,
); );


return 'https://open.login.yahooapis.com/openid/op/auth?'.http_build_query($openid_request); return $openIdEndpoint.'?'.http_build_query($openid_request);
}


public function validateOpenID()
{

} }


public function getRequestToken($callback = "oob") public function getRequestToken($callback = "oob")
Expand Down Expand Up @@ -273,7 +267,7 @@ public function getContact($guid = NULL, $cid)
{ {
$guid = $this->token->yahoo_guid; $guid = $this->token->yahoo_guid;
} }

$url = sprintf(YahooOAuthClient::SOCIAL_API_URL.'/user/%s/contact/%s', $guid, $cid); $url = sprintf(YahooOAuthClient::SOCIAL_API_URL.'/user/%s/contact/%s', $guid, $cid);
$parameters = array('format' => 'json'); $parameters = array('format' => 'json');


Expand Down Expand Up @@ -309,7 +303,7 @@ public function syncContacts($guid = null, $contactsync)
{ {
$guid = $this->token->yahoo_guid; $guid = $this->token->yahoo_guid;
} }

$url = sprintf(YahooOAuthClient::SOCIAL_API_URL.'/user/%s/contacts', $guid); $url = sprintf(YahooOAuthClient::SOCIAL_API_URL.'/user/%s/contacts', $guid);
$parameters = array('format' => 'json'); $parameters = array('format' => 'json');


Expand All @@ -323,7 +317,7 @@ public function syncContacts($guid = null, $contactsync)


return $http['response_body']; return $http['response_body'];
} }

public function addContact($guid, $contact) public function addContact($guid, $contact)
{ {
if($guid == null && !is_null($this->token)) if($guid == null && !is_null($this->token))
Expand Down

0 comments on commit e18f916

Please sign in to comment.