Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
facebook connect style twitter oauth
http://twitter-connect.heroku.com
sudo gem install twitter-connect
1 define config/twitter.yml
development:
consumer_token:
consumer_secret:
logout_url:
production:
consumer_token:
consumer_secret:
logout_url:
consumer_token and consumer_secret are fetched after you registered a twitter app. logout_url is where the app go to when user logs out or the session expired.
2 define routes
map.twitter_oauth '/twitter_oauth', :controller => 'twitter_connects', :action => 'oauth'
map.twitter_callback '/twitter_callback', :controller => 'twitter_connects', :action => 'callback'
map.twitter_logout '/twitter_logout', :controller => 'twitter_connects', :action => 'logout'
3 add javascript to html header
<%= javascript_include_tag 'twitter_connect' %>
4 add twitter login link on view page
<%= tc_login_button "window.location.reload()" %>
Or:
<%= tc_login_button "window.location.href = '#{tweets_path}'", :class_name => 'twitter_button' %>
tc_login_button
has two parameters, first is the callback javascript, second is customized parameter :text or :class_name
5 add twitter logout link on view page
<%= link_to "Logout from Twitter", twitter_logout_path %>
6 get twitter information or post tweet
class TwitterConnect < ApplicationController
include TwitterOauth
def tweet
oauth = get_oauth
client = Twitter::Base.new(oauth)
client.update('test')
end
end
Copyright (c) 2010 [Richard Huang], released under the MIT license
FAQs
Unknown package
We found that twitter_connect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.