diego81 / omnicontacts Goto Github PK
View Code? Open in Web Editor NEWA generalized Rack middleware for importing contacts from major email providers.
A generalized Rack middleware for importing contacts from major email providers.
Hello, Thanks for writing and maintaing this gem. I' running into an issue using the gmail importer. When accessing /contacts/gmail the url sent to google is this "https://accounts.google.com/o/oauth2/auth?client_id=xxxx" this gives me a "Error: invalid_request" from Google. Any help determining why all the params are not being sent would be helpful.
Thanks
Many of the bigger websites use oath and have a popup for the auth window.
So your application is below the oath popup.
Is there some way to achieve this or is this impossible?
Im looking into the options at this moment as I have done before ut havent been able to get something solid working.
I tried creating a new rails (v3.2.3) application and everything is working fine there. I could fetch the contacts.
But when I tried to implement the same for another rails (v3.0.9) application (using rack v1.2.4), got the error:
Ruby /media/workspace/ynl/vendor/cache/ruby/1.9.1/gems/rack-1.2.4/lib/rack/lint.rb: in assert, line 19
Can anybody help fixing this?
Hi! First of all, thanks for the gem!
I think this requires a simple fix, but not sure where to look/see since it looks like I have everything correctly....
I have a link to [my_domain]/contacts/gmail on a test page. When I click on the link, I get the following error. I double-checked OAuth Key and Secret, and they are correct.
Error: invalid_client
Request Details
scope=https://www.google.com/m8/feeds
response_type=code
access_type=online
redirect_uri=http://[my_domain]/contacts/gmail/callback
approval_prompt=auto
client_id=[OAuth Consumer Key]
Any help would be much appreciated!
Thanks.
The error is here
Error internal_error while processing /contacts/yahoo: oauth_problem=consumer_key_unknowncache
Hi,
Once the user clicks on the gmail link (havent started tested the others yet), I go to google and on the callback i get this error:
Started POST "/contacts/gmail" for 127.0.0.1 at 2012-03-28 14:34:16 +0200
Started GET "/oauth2callback?code=4/JRqeE4JhdgYeqOtDesifrYFJ7FFY" for 127.0.0.1 at 2012-03-28 14:34:20 +0200
SocketError (getaddrinfo: H�te inconnu. ):
I'm running on localhost. Hôte Inconnu = unknown host in french :)
Hey, thanks for awesome info and example in readme, i'm able get the contacts now,but now in my site i dont want to redirect and trying to input username and pass with request and get ajax response and display because importing contacts is part of the form and i don't want to reload it. i saw "login_hint" parameter in authorization but it only has username option.i want to login and get contacts in background and get results.
any ideas?
I am getting this
Error :The redirect URI in the request: http://example.com/contacts/gmail/callback did not match a registered redirect URI
But from my computer or credential I am able to access the email this error only showing when I am testing on other computer.
I use "/contacts/gmail/callback" as callback URL and also add this in my routes.rb file
Please help me.
Thanks in advance.
Salayhin
I would like to get contacts of acc with email address only without pwd as something like
facebook graph api.
Is there any chance to get like facebook graph api in google api?
Please help me,
Thanks in advance.
Has anyone forked a solution that tracks the contact id passed by the provider?
For example with hotmail:
{"id":"contact.3dca7e65000000000000000000000011"
Gmail:
http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base/8411573
Yahoo:
"uri": "http://social.yahooapis.com/v1/user/XMCDY3KDAYNPDILERMPN3PHPKU/contact/114"
The idea being that you want to track these ids so that on the next contact import you can find/update/skip through the previously imported records.
Thoughts? Thank
request.env['omnicontacts.user'] has no value when authenticating with a Google account. Is this just me having this issue? request.env['omnicontacts.contacts'] works as expected.
Hi, this is a request for you to add a link to the correct place to get an API key in the readme because like this guy who previously filed an issue I went here by accident. I figure a few people might do that so it'd be really handy, other than that, great gem. thanks!
I've been using omnicontacts in our production environment for nearly a year now (still on version 0.2.2!) and I haven't had any problems. However, in a recent import (around 1 month ago) from Gmail for one particular user returned 900 contacts, where all contacts had the email field formatted with 'FIRST_NAME LAST_NAME|[email protected]'. So for example, one email field would be "John Chow|[email protected]".
I'm not sure if anyone has seen this issue before, and while it only has happened once for all our imports, I just want to double check here before I brush it off as a one time burp from Gmail.
The README current says "profile_image" whereas in the code it is "profile_picture".
gmail.rb:64 errors with "can't convert String into Integer" when importing a contact with a spouse listed.
contact[:relation] = entry["gContact$relation"]["rel"] if entry['gContact$relation']
Adding the oauth2 'state' parameter would be very useful in determining the application state without employing cookies e.g. returning to a newly created page.
Forked here:
https://github.com/jasukkas/omnicontacts/commit/48d9b9d3b127843e00b36ceae8b534ca57c1de94
I have the gem working for gmail. I can see the list of contacts in
@contacts = request.env['omnicontacts.contacts']
However, when importing via hotmail, the list is empty. I made sure that I have hotmail contacts. I double checked every settings in my live
application (secret key, domain...)
Has anyone had a similar issue ? What can I try to diagnose further ?
NoMethodError (undefined method each' for nil:NilClass): omnicontacts (0.1.2) lib/omnicontacts/importer/yahoo.rb:47:in
contacts_from_response'
To help integration testing it is nice to add mock helpers following OmniAuth's style.
The relative WIKI page of the OmniAuth project could be used as a reference: https://github.com/intridea/omniauth/wiki/Integration-Testing
Outlook.com (prv Hotmail) doesn't provide email address anymore
The register url for Google is provided, but it would be nice to include these also. Thanks!
Yahoo: https://developer.apps.yahoo.com/dashboard/createKey.html
Hotmail: https://account.live.com/developers/applications/create
Rack::Lint is automatically turned on in development mode and it causes errors when you redirect to a provider. So when I go to /contacts/yahoo I get
Rack::Lint::LintError at /contacts/yahoo
No Content-Type header found
Ruby /Users/.../.rvm/gems/ruby-1.9.2-p0/gems/rack-1.4.1/lib/rack/lint.rb: in assert, line 19
Web GET 127.0.0.1/contacts/yahoo
(more info given in the end)
These errors do not appear in test or production mode because Rack::Lint is turned off in test mode...
Looking around I saw a similar issue and patch here ... demandforce/rack-oauth2-server#31 and renatosnrg/rack-oauth2-server@03cd9ef
Can you integrate a similar solution while redirecting ?
More Debug Info :
GET
No GET data.
POST
No POST data.
Rack ENV
Variable Value
HTTP_ACCEPT
text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
HTTP_ACCEPT_CHARSET
ISO-8859-1,utf-8;q=0.7,*;q=0.3
HTTP_ACCEPT_ENCODING
gzip,deflate,sdch
HTTP_ACCEPT_LANGUAGE
en-US,en;q=0.8
HTTP_CONNECTION
keep-alive
HTTP_COOKIE
remember_user_token=BAhbB1sGaV1JIiIkMmEkMTAkRVdIYnBkUWNHSGoyN2tRN3JpWDZHTwY6BkVU--7b1f213ca394eca4af5267caf05bc3c610d6282c; _session_id=02a91f0ed24c086ca1b5672dcfd2ca55
HTTP_HOST
127.0.0.1:8081
HTTP_REFERER
http://127.0.0.1:8081/rewards/friends
HTTP_USER_AGENT
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.57 Safari/537.1
HTTP_VERSION
HTTP/1.1
ORIGINAL_FULLPATH
/contacts/yahoo
PATH_INFO
/contacts/yahoo
QUERY_STRING
REMOTE_ADDR
127.0.0.1
REQUEST_METHOD
GET
REQUEST_PATH
/contacts/yahoo
REQUEST_URI
/contacts/yahoo
SCRIPT_NAME
SERVER_NAME
127.0.0.1
SERVER_PORT
8081
SERVER_PROTOCOL
HTTP/1.1
SERVER_SOFTWARE
Unicorn 4.3.1
I have upgraded from version 0.2.2 to 0.3.1 and in the callback I am getting the following:
The error thrown is this:
JSON::ParserError at /google_callback
757: unexpected token at '<?xml version='1.0' encoding='UTF-8'?><feed...[more xml here]
In the trace, in omnicontacts-0.3.1/lib/omnicontacts/importer/gmail.rb l.36, the variable response_as_json
is the response, but as xml. So maybe the request sent to gmail does not specify that the result must be as json... How to force the response from gmail to be json ?
I don't know how to troubleshoot further.
Any suggestions ?
Sorry to ask stupid question... but which service to select from there, i have selected " Groups Settings API ", but no luck... :(
In the code at this line : https://github.com/Diego81/omnicontacts/blob/master/lib/omnicontacts/http_utils.rb#L77 the headers argument has a default value of an empty Array and that is what gets passed on to the Ruby's HTTP implementation resulting in an exception because Ruby's HTTP library expects it to be a Hash.
Relevant documentation is here : https://github.com/ruby/ruby/blob/trunk/lib/net/http.rb#L1090
The exception occurs at this point : https://github.com/ruby/ruby/blob/trunk/lib/net/http/generic_request.rb#L34 where it is trying to see if initheader has any keys, but the Array object that is sent from earlier does not respond to keys method resulting in NoMethodError.
The change needed to fix this is minimal. The [] should change to {}. I am submitting a pull request regarding the same.
Note : In practice this error occurs only with Hotmail importer. Gmail importer providers its own Hash of headers, overriding the default value and Yahoo importer uses the http_get method which does not have headers parameter.
Has this been tested lately? Not able to read contacts from hotmail using this gem.
Hey Guys,
I have tried using latest version of omnicontacts 0.2.5, I have tried to import contacts for facebook, but when i define importer in config/initializer/omnicontacts.rb. It gives error "Could not find importer facebook"
Then, I looked into the gem, i see there is no importer for facebook.
Please guide me.
I'm just wondering if this is an existing issue or not, or if we just implemented it wrongly. After providing my credentials and agreeing on gmail/yahoo authentication it renders my callback page with the list of my contacts. Now when I tried to refresh the page it renders a Routing Error.
No route matches [GET] "/contacts/failure"
Please let me know your thoughts on this.
Thanks,
marc
Hi All,
Is there a way to adjust the message that Google displays to the user? The problem is that some users might think that the app will edit or delete existing contacts rather than simply making a copy of them. I looked in https://code.google.com/apis/console/ but didn't find a way to adjust the message. Thanks!!
Default Message from Google:
[App Name] is requesting permission to:
Manage your contacts
View and manage your Google Contacts
Can we please have support for linkedin as well to import the address book?
Seems to be related to rack 1.4 support. From the current OmniAuth code it appears that line 26 of builder.rb should be:
@ins << @app unless rack14? || @ins.include?(@app)
Going to test and if all looks good will submit a pull request.
Thanks
I think maybe Hotmail should be removed from the list of supported e-mail services. After spending too much time debugging why omnicontacts was returning an empty array for Hotmail contacts, I realized it's because the API returns this:
{
"data": [
{
"first_name": "John",
"last_name": "Doe",
"name": "John Doe",
<snip>
"email_hashes": [
"f37cb083473f0fef7f3b4172ccd2ff6070f3e7ccd1752be79c3a2d7ba40decd5"
],
"updated_time": "2012-08-01T16:29:17+0000"
}
]
}
So, in other words, you can't ever get a list of e-mail addresses from it.
I had to add an extra parameter to the 'fetch_contacts_using_access_token' in the gmail.rb importer file to accept an additional 'contacts_req_params' like this:
def contacts_req_params
{ "q" => @contact_name.to_s, "max-results" => @max_results.to_s }
end
This causes an error message in the console, 'This services does not support the q parameter', which should be allowed according to the API docs. Any advice/input on how to extend the functionality to accept string parameters would be awesome. Thanks!
myapp.com/contacts/gmail creates an open link that opens the oauth screen for a selected provider that cannot be protected behind a login.
I need better way to handle this, currently using devise and in regular controllers you can set it so a users first needs to be logged in.
Is there a way to force this somehow?
This gem is very nice but these things still a bit rough out of the box to use it as production
Looks like this is not the code that is in the latest master branch. Can you update rubygems.org?
Thanks
TypeError: no implicit conversion of String into Integer
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/importer/gmail.rb:64 in "[]"
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/importer/gmail.rb:64 in "block in contacts_from_response"
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/importer/gmail.rb:41 in "each"
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/importer/gmail.rb:41 in "contacts_from_response"
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/importer/gmail.rb:24 in "fetch_contacts_using_access_token"
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/middleware/oauth2.rb:52 in "fetch_contacts"
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/middleware/base_oauth.rb:66 in "block in handle_callback"
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/middleware/base_oauth.rb:76 in "execute_and_rescue_exceptions"
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/middleware/base_oauth.rb:62 in "handle_callback"
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/middleware/base_oauth.rb:39 in "call"
/vendor/bundle/ruby/2.0.0/gems/omnicontacts-0.3.4/lib/omnicontacts/builder.rb:27 in "call"
/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.8.164/lib/new_relic/rack/error_collector.rb:43 in "call"
/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.8.164/lib/new_relic/rack/agent_hooks.rb:22 in "call"
/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.8.164/lib/new_relic/rack/browser_monitoring.rb:16 in "call"
/vendor/bundle/ruby/2.0.0/gems/hirefireapp-0.2.0/lib/hirefireapp/middleware.rb:27 in "call"
/vendor/bundle/ruby/2.0.0/gems/sass-3.2.12/lib/sass/plugin/rack.rb:54 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/best_standards_support.rb:17 in "call"
/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/etag.rb:23 in "call"
/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/conditionalget.rb:25 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/head.rb:14 in "call"
/vendor/bundle/ruby/2.0.0/gems/remotipart-1.2.1/lib/remotipart/middleware.rb:27 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/params_parser.rb:21 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/flash.rb:242 in "call"
/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210 in "context"
/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/cookies.rb:341 in "call"
/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13.rc2/lib/active_record/query_cache.rb:64 in "call"
/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13.rc2/lib/active_record/connection_adapters/abstract/connection_pool.rb:479 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/callbacks.rb:28 in "block in call"
/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13.rc2/lib/active_support/callbacks.rb:405 in "_run__4304472764325038590__call__1715657587715444291__callbacks"
/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13.rc2/lib/active_support/callbacks.rb:405 in "__run_callback"
/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13.rc2/lib/active_support/callbacks.rb:385 in "_run_call_callbacks"
/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13.rc2/lib/active_support/callbacks.rb:81 in "run_callbacks"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/callbacks.rb:27 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/remote_ip.rb:31 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/debug_exceptions.rb:16 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/show_exceptions.rb:56 in "call"
/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13.rc2/lib/rails/rack/logger.rb:32 in "call_app"
/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13.rc2/lib/rails/rack/logger.rb:16 in "block in call"
/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13.rc2/lib/active_support/tagged_logging.rb:22 in "tagged"
/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13.rc2/lib/rails/rack/logger.rb:16 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/request_id.rb:22 in "call"
/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/methodoverride.rb:21 in "call"
/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/runtime.rb:17 in "call"
/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13.rc2/lib/active_support/cache/strategy/local_cache.rb:72 in "call"
/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/lock.rb:15 in "call"
/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13.rc2/lib/action_dispatch/middleware/static.rb:63 in "call"
/vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:136 in "forward"
/vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:245 in "fetch"
/vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:185 in "lookup"
/vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:66 in "call!"
/vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:51 in "call"
/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13.rc2/lib/rails/engine.rb:479 in "call"
/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13.rc2/lib/rails/application.rb:223 in "call"
/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13.rc2/lib/rails/railtie/configurable.rb:30 in "method_missing"
/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/deflater.rb:13 in "call"
/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:552 in "process_client"
/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:632 in "worker_loop"
/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.8.164/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:22 in "call"
/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.6.8.164/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:22 in "block (4 levels) in <top (required)>"
/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500 in "spawn_missing_workers"
/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:142 in "start"
/vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn:126 in "<top (required)>"
/vendor/bundle/ruby/2.0.0/bin/unicorn:23 in "load"
/vendor/bundle/ruby/2.0.0/bin/unicorn:23 in "<main>"
Question-
How would you want to handle the max number of contacts for Gmail - if it were to be a configurable parameter? Right now it's set to 100 in the importer, but I'm thinking if in the initializer you could pass a parameter like:
importer :gmail, "xxx", "yyy", :max_contacts => 1000
or something like that. Have you given this any thought?
Great gem by the way!
Arun
In the following sentence,
To use the Gem you first need to redirect your users to /contacts/:importer, where :importer can be google, yahoo or hotmail.
"google" should be "gmail".
i'm able to get the response from the site but not able to rout to my page and getting routing errors
uninitialized constant ContactsLists
or
uninitialized constant ContactsListsController
config files are below
initilizers/omnicontacts.rb
Rails.application.middleware.use OmniContacts::Builder do
importer :gmail, "client_id", "client_secret", {:redirect_path => "/contact_callback"}
end
in google console
Redirect URI is set to http://localhost:3000/contact_callback
and i want to route the data to my contact_list controller and invite method so in routes i have defined
match "contact_callback" => '/contacts_lists/invitenew'
and i'm getting
let me know what i'm doing wrong.
thanks
Thanks for writing this great gem, I try to make it work in my app but the client_secret is no longer available in the google api console.
Or does one have to enable any of the api's in the google api console? Its very unclear at this point, could you perhaps please upgrade the docs with a step by step on how to set it up?
Thanks in advanche for all your hard work on this gem it rocks
I tried with below keeping client_secret empty ( no idea where to find it else )
initializer:
require "omnicontacts"
Rails.application.middleware.use OmniContacts::Builder do
#importer :gmail, "xxx.apps.googleusercontent.com", "", {:redirect_path => "/oauth2callback", :ssl_ca_file => "/etc/ssl/certs/curl-ca-bundle.crt"}
importer :gmail, "xxx.apps.googleusercontent.com", "", {:redirect_path => "/callback", :ssl_ca_file => "/etc/ssl/certs/curl-ca-bundle.crt"}
importer :yahoo, "consumer_id", "consumer_secret", {:callback_path => '/callback'}
importer :hotmail, "client_id", "client_secret"
end
this results in:
invalid_client error
scope=https://www.google.com/m8/feeds
response_type=code
access_type=offline
redirect_uri=http://mydomain.com/oauth2callback
approval_prompt=force
client_id=client_id
And where should the .crt be placed ( what file is this and how to use it?)
I have got contacts from the google as I registered in google developer console .
But I unable to get contacts from yahoo while redirecting to app and I registered in yahoo developers and given redirection url where It has been redirecting without any data as below,
/callback?oauth_token=qvufcvp&oauth_verifier=hp9knk
Please help me, Is there any wrong I did?
Thanks in advance.
Is there a way to get the email address of the user who fetched the records, as well as secret token to store in database so that he doesn't have to authorize it every time. I need it for gmail. There should be a guide for it in README.
I'm obtaining the following error when contacting to google.
NoMethodError (undefined method `use_ssl=' for #<Net::HTTP accounts.google.com:443 open=false>):
Full stack trace:
omnicontacts (0.2.3) lib/omnicontacts/http_utils.rb:84:in https_connection' omnicontacts (0.2.3) lib/omnicontacts/http_utils.rb:69:in
https_post'
omnicontacts (0.2.3) lib/omnicontacts/authorization/oauth2.rb:43:in fetch_access_token' omnicontacts (0.2.3) lib/omnicontacts/middleware/oauth2.rb:50:in
fetch_contacts'
omnicontacts (0.2.3) lib/omnicontacts/middleware/base_oauth.rb:66:in handle_callback' omnicontacts (0.2.3) lib/omnicontacts/middleware/base_oauth.rb:76:in
execute_and_rescue_exceptions'
omnicontacts (0.2.3) lib/omnicontacts/middleware/base_oauth.rb:62:in handle_callback' omnicontacts (0.2.3) lib/omnicontacts/middleware/base_oauth.rb:39:in
call'
omnicontacts (0.2.3) lib/omnicontacts/builder.rb:27:in call' warden (1.0.6) lib/warden/manager.rb:35:in
call'
warden (1.0.6) lib/warden/manager.rb:34:in catch' warden (1.0.6) lib/warden/manager.rb:34:in
call'
actionpack (3.2.9) lib/action_dispatch/middleware/best_standards_support.rb:17:in call' rack (1.4.1) lib/rack/etag.rb:23:in
call'
rack (1.4.1) lib/rack/conditionalget.rb:25:in call' actionpack (3.2.9) lib/action_dispatch/middleware/head.rb:14:in
call'
actionpack (3.2.9) lib/action_dispatch/middleware/params_parser.rb:21:in call' actionpack (3.2.9) lib/action_dispatch/middleware/flash.rb:242:in
call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in context' rack (1.4.1) lib/rack/session/abstract/id.rb:200:in
call'
actionpack (3.2.9) lib/action_dispatch/middleware/cookies.rb:341:in call' activerecord (3.2.9) lib/active_record/query_cache.rb:64:in
call'
activerecord (3.2.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in call' actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:28:in
call'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in _run__84874920__call__4__callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:405:in
send'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in __run_callback' activesupport (3.2.9) lib/active_support/callbacks.rb:385:in
_run_call_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in send' activesupport (3.2.9) lib/active_support/callbacks.rb:81:in
run_callbacks'
actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (3.2.9) lib/action_dispatch/middleware/reloader.rb:65:in
call'
actionpack (3.2.9) lib/action_dispatch/middleware/remote_ip.rb:31:in call' actionpack (3.2.9) lib/action_dispatch/middleware/debug_exceptions.rb:16:in
call'
actionpack (3.2.9) lib/action_dispatch/middleware/show_exceptions.rb:56:in call' railties (3.2.9) lib/rails/rack/logger.rb:32:in
call_app'
railties (3.2.9) lib/rails/rack/logger.rb:16:in call' activesupport (3.2.9) lib/active_support/tagged_logging.rb:22:in
tagged'
railties (3.2.9) lib/rails/rack/logger.rb:16:in call' actionpack (3.2.9) lib/action_dispatch/middleware/request_id.rb:22:in
call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in call' rack (1.4.1) lib/rack/runtime.rb:17:in
call'
activesupport (3.2.9) lib/active_support/cache/strategy/local_cache.rb:72:in call' rack (1.4.1) lib/rack/lock.rb:15:in
call'
actionpack (3.2.9) lib/action_dispatch/middleware/static.rb:62:in call' railties (3.2.9) lib/rails/engine.rb:479:in
call'
railties (3.2.9) lib/rails/application.rb:223:in call' rack (1.4.1) lib/rack/content_length.rb:14:in
call'
railties (3.2.9) lib/rails/rack/log_tailer.rb:17:in call' rack (1.4.1) lib/rack/handler/webrick.rb:59:in
service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in
run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:in
start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in
start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in each' /usr/lib/ruby/1.8/webrick/server.rb:92:in
start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in start' /usr/lib/ruby/1.8/webrick/server.rb:82:in
start'
rack (1.4.1) lib/rack/handler/webrick.rb:13:in run' rack (1.4.1) lib/rack/server.rb:265:in
start'
railties (3.2.9) lib/rails/commands/server.rb:70:in start' railties (3.2.9) lib/rails/commands.rb:55 railties (3.2.9) lib/rails/commands.rb:50:in
tap'
railties (3.2.9) lib/rails/commands.rb:50
script/rails:6:in `require'
script/rails:6
How can I override the Listening path to listen for a scoped route instead of just contacts/provider? So that I may have url like such: http://host.com/scoped_dir/contacts/:provider. Any help would be greatly appreciated.
Can I prevent users being asked to authorize my app every time they retrieve contacts from Google?
I'm about to start working on this. It looks fairly straightforward, but wanted to see if you have any thoughts on the best way to do it.
A branch of the contacts gem did it like so:
yehezkielbs/contacts@0ed6600
and
yehezkielbs/contacts@48299e8
It looks like something similar will work for omnicontacts. Thoughts?
** UPDATE ** working now...apparently any error in the controller method handling the callback raises an internal_error. In my case, this statement "raise request.env["omnicontacts.contacts"].to_yaml" was causing the error, no idea why.
After clicking the link to get yahoo contacts i get redirected to
"/contacts/failure?error_message=internal_error"
In the rails console, i get this message:
"Error internal_error while processing /contacts/yahoo/callback" followed by my contacts.
So my contacts are being fetched but the error is also thrown. Any ideas as to why this would happen? It would be helpful if internal_error was a little verbose about what the actual error is.
I'm trying to integrate omnicontacts in sinatra and, because sinatra uses lint, I'm getting the following error if I'm not in production mode when the browser tries to redirect. This happens to hotmail, gmail and yahoo:
Rack::Lint::LintError at /contacts/yahoo
No Content-Type header found
Ruby ruby/gems/1.9.1/gems/rack-1.3.0/lib/rack/lint.rb: in assert, line 19
To ensure Rack protocol is being followed, there must be a Content-type header in all responses, except when the status is 1xx, 204 or 304.
So, for example, in:
[302, {"location" => authorization_url}, []] you need to change to:
[302, {Content-Type" => "respective_content_type", "location" => authorization_url}, []]
This need to be done in every place where you are returning a http status like the line above.
I think for the redirect url the content type would be "application/x-www-form-urlencoded"
omnicontacts 0.2.0
The callback catches the redirect from Yahoo after giving permission to the application, but errors occur.
I was getting this first:
NoMethodError (undefined method `<=>' for :oauth_signature_method:Symbol):
Then after implementing hotmail, I tried again, and got this:
NoMethodError (undefined method `<=>' for :view:Symbol):
After commenting out this in the yahoo.rb
#:view => "compact"
The first error returned again, commenting that out just lead to another error on another item in the hash, and so on. This seems like a syntax issue with rails, not necessarily the plugin, but I'm not sure.
contacts/ is hardcoded, make this variable so we can easily change the location of the mounting route.
In my case I wanted to use /imports instead since I already had associated controllers/views for that in my application.
Hotmail throws an
The provided value for the input parameter 'redirect_uri' is not valid. The domain of the provided redirect URI must match the domain of the redirect URI registered for this app.
I followed all docs and the example app, there should not be a redirect_uri param in the initialiser at hotmail section?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.