0

I have a rails application and i am using omnicontacts gem to import contacts from yahoo, gmail, and outlook.Its working fine.But once i import contacts from any account say of gmail, and tries to import contacts from another account it does not ask me to login using another account for importing contacts from it. Here is my omnicontacts initializer.Please help, I can add more info if needed.

config/initializers/omnicontacts.rb

Rails.application.middleware.use OmniContacts::Builder do
   importer :gmail, ENV['GMAIL_ID'], ENV['GMAIL_SECRET'], redirect_path: '/invites/gmail/contact_callback', max_results: 1000
   importer :yahoo, ENV['YAHOO_ID'], ENV['YAHOO_SECRET'], callback_path: '/invites/yahoo/contact_callback', max_results: 1000
   importer :outlook, ENV['OUTLOOK_APP_ID'], ENV['OUTLOOK_APP_KEY'], redirect_path: '/invites/outlook/contact_callback', max_results: 1000
end
Sachin Singh
  • 7,107
  • 6
  • 40
  • 80
  • 2
    Gmail supports an authorization parameter that lets you specify this behaviour. If you add `prompt=select_account` to the authorization URL, it will always prompt the user to pick their account, even when there are only signed into one. I'm not familiar with `omnicontacts` and at first glance I don't see a way to add the URL param. It looks like you'd want a way to optionally add it [here](https://github.com/Diego81/omnicontacts/blob/63165cdedc8704941a1c0c10bcf32fb9bd5f1947/lib/omnicontacts/authorization/oauth2.rb#L28). – Graeme May 04 '17 at 16:53
  • @Graeme it does not seems to work, can you help me fixing same issue with `outlook` or `yahoo`? – Sachin Singh May 05 '17 at 05:38
  • As far as I can tell, the desired behaviour is the default using Outlook.com. And Yahoo doesn't appear to support such an option according to [their documentation](https://developer.yahoo.com/oauth2/guide/flows_authcode/#step-2-get-an-authorization-url-and-authorize-access). However, Yahoo lets users add or switch accounts with their Account Manager in the OAuth window only if the browser window is wide enough. Mobile users are out of luck it seems. – Graeme May 05 '17 at 21:16

0 Answers0