Created
July 8, 2010 15:40
-
-
Save tejima/468172 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function executeIndex(sfWebRequest $request) | |
{ | |
$client = OpenPNEOAuth::getInstance('http://twitter.com/',Doctrine::getTable('SnsConfig')->get('awt_consumer'), Doctrine::getTable('SnsConfig')->get('awt_se | |
cret')); | |
//$token = $client->getRequestToken( Doctrine::getTable('SnsConfig')->get('awt_host').'auth/settoken/'); | |
$token = $client->getRequestToken("http://www.tejimaya.com"); | |
error_log("p:". print_r($token,true)."\n",3,'/tmp/aaaaa'); | |
error_log("getAuthorizeUrl():".OpenPNEOAuth::getInstance()->getAuthorizeUrl($token)."\n",3,'/tmp/aaaaa'); | |
error_log("awt_consumer:".Doctrine::getTable('SnsConfig')->get('awt_consumer')."\n",3,'/tmp/aaaaa'); | |
error_log("awt_secret:".Doctrine::getTable('SnsConfig')->get('awt_secret')."\n",3,'/tmp/aaaaa'); | |
error_log("awt_host:".Doctrine::getTable('SnsConfig')->get('awt_host')."\n",3,'/tmp/aaaaa'); | |
//header('Location: '.OpenPNEOAuth::getInstance()->getAuthorizeUrl($token)); // 認可用 URL を取得し、リダイレクト | |
header('Location: ' . 'http://twitter.com/oauth/authenticate?oauth_token='.$token['oauth_token']); | |
exit; | |
//return sfView::SUCCESS; } | |
public function executeSettoken(sfWebRequest $request) | |
{ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
twitterのワンクリックログインはauthenticate を使う。