단 여기서 중요한 것은 "Callback URL"을 입력하는 것이다. (sv.mobiconsoft.co.kr은 /etc/hosts파일에 설정한 테스트 도메인)
$ sudo vi /etc/hosts
127.0.0.1 sv.mobiconsoft.co.kr
// ping 성공
$ ping sv.mobiconsoft.co.kr
PING sv.mobiconsoft.co.kr (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.044 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.051 ms
everyauth
.twitter
.consumerKey('2yQ.....img')
.consumerSecret('TbhKnP.....fQ1gyvUO4')
.findOrCreateUser( function (sess, accessToken, accessSecret, twitUser) {
console.log('twitter User data is', twitUser);
return usersByTwitId[twitUser.id] || (usersByTwitId[twitUser.id] = addUser('twitter', twitUser));
})
.redirectPath('/');
$ sudo node app.js
starting step - getRequestToken
...finished step
starting step - storeRequestToken
...finished step
starting step - redirectToProviderAuth
...finished step
starting step - extractTokenAndVerifier
...finished step
starting step - getSession
...finished step
starting step - rememberTokenSecret
...finished step
starting step - getAccessToken
...finished step
starting step - fetchOAuthUser
...finished step
starting step - assignOAuthUserToSession
...finished step
starting step - findOrCreateUser
twitter User data is { id: 48553254,
id_str: '48553254',
name: 'Software 행복공동체 키우기',
screen_name: 'nulpulum',
location: 'Seoul Korea',
description: '자건거타기 실용주의프로그래머 에자일정신 글로벌소프트웨어만들기 행복공통체키우기 지식나눔운동',
url: 'http://t.co/wunTkx6q',
entities: { url: { urls: [Object] }, description: { urls: [] } },
protected: false,
followers_count: 98,
friends_count: 533,
listed_count: 0,
created_at: 'Fri Jun 19 00:44:39 +0000 2009',
favourites_count: 12,
utc_offset: 32400,
time_zone: 'Seoul',
geo_enabled: true,
verified: false,
statuses_count: 506,
lang: 'ko',
status:
{ created_at: 'Fri Oct 04 12:15:34 +0000 2013',
id: 386102292232937500,
id_str: '386102292232937472',
text: 'I signed up for Human-Computer Interaction from @ucsandiego on @Coursera! https://t.co/FdQc2h654C #hci',
source: '<a href="http://twitter.com/tweetbutton" rel="nofollow">Tweet Button</a>',
truncated: false,
in_reply_to_status_id: null,
in_reply_to_status_id_str: null,
in_reply_to_user_id: null,
in_reply_to_user_id_str: null,
in_reply_to_screen_name: null,
geo: null,
coordinates: null,
place: null,
contributors: null,
retweet_count: 0,
favorite_count: 0,
entities:
{ hashtags: [Object],
symbols: [],
urls: [Object],
user_mentions: [Object] },
favorited: false,
retweeted: false,
possibly_sensitive: false,
lang: 'en' },
contributors_enabled: false,
is_translator: false,
profile_background_color: '9AE4E8',
profile_background_image_url: 'http://abs.twimg.com/images/themes/theme16/bg.gif',
profile_background_image_url_https: 'https://abs.twimg.com/images/themes/theme16/bg.gif',
profile_background_tile: false,
profile_image_url: 'http://a0.twimg.com/profile_images/2956822008/b20249749c11917f4ce9e29263ba1b92_normal.jpeg',
profile_image_url_https: 'https://si0.twimg.com/profile_images/2956822008/b20249749c11917f4ce9e29263ba1b92_normal.jpeg',
profile_banner_url: 'https://pbs.twimg.com/profile_banners/48553254/1355144673',
profile_link_color: '0084B4',
profile_sidebar_border_color: 'BDDCAD',
profile_sidebar_fill_color: 'DDFFCC',
profile_text_color: '333333',
profile_use_background_image: true,
default_profile: false,
default_profile_image: false,
following: false,
follow_request_sent: false,
notifications: false }
...finished step
starting step - compileAuth
...finished step
starting step - addToSession
...finished step
starting step - sendResponse
...finished step