TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Quick and simple PHP Twitter login for your site, ideal for your weekend project

14 pointsby makethetickabout 14 years ago

3 comments

nbpooleabout 14 years ago
Security note: Check out the following lines, taken from the PHP API client used by this application (<a href="https://github.com/jmathai/twitter-async/blob/master/EpiOAuth.php#L173" rel="nofollow">https://github.com/jmathai/twitter-async/blob/master/EpiOAut...</a>):<p><pre><code> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); </code></pre> Those lines disable certificate verification: if I can intercept the connection between this client and Twitter, I can present my own, self-signed certificate and the client will still send requests as if I were twitter.com. This completely defeats the purpose of using SSL for connections.
评论 #2512747 未加载
pavel_lishinabout 14 years ago
One big problem I see right off the bat: the twitterLogin() function completely breaks any page I embed this in, since if a visitor isn't logged in, all they see is a link to twitter, and then <i>nothing</i> since you're calling exit().<p>Another nitpick: if I'm logged in, and twitterCallback() is called, why is it redirecting me to / ? Perhaps my site is nested deep within a directory structure.
评论 #2513121 未加载
评论 #2513588 未加载
thereabout 14 years ago
<p><pre><code> echo "&#60;p&#62;You are logged in as ".$_SESSION['logged_in'].".&#60;/p&#62;"; </code></pre> <i>shiver</i>
评论 #2512320 未加载
评论 #2512749 未加载
评论 #2513137 未加载