SMS service for two-factor authentication in Rails - ruby

I have already implemented two-factor authentication using the tinfoil gem in Rails. It's using Google Authenticator to display the verification code to the user.
I would also like to implement sending the verification code to the user via SMS. I am wondering what is the best solution for this?
I have also searched around and found free SMS services for Rails like SMS FU and SMS-easy, but it seems like the gems are not active and they don't support a lot of the UK carriers.
So, should I resort to paid service like twilio?

Twilio developer evangelist here.
For something important like two factor authentication, where you need the messages to arrive or your user cannot log in, then I highly recommend a paid service.
StackOverflow is not exactly the right site to be asking for opinions on this sort of thing, it is more for code issues that can be solved. However, if you are interested in using Twilio for this and you find yourself with any questions about the service, you can contact me directly at philnash#twilio.com.

Related

Rails4. Contacts importer from famous providers (Gmail, Facebook...)

Problem
Need to implement contacts importer/chooser on Rails4 project. Needed providers - Gmail, Facebook, Yahoo, LinkedIn, Outlook.
Researches
Tried omnicontacts and contacts gems but both has some limitations and maybe outdated for some providers.
There is commercial project which do this for you - CloudSponge , but I prefer open source.
Current Status
Implemented Linkedin contacts import using devise, omniauth, omniauth-linkedin.
Implemented Gmail contacts import using omnicontatcs.
Failed with other providers.
Queastion
Is there any other all-in-one solutions (maybe I missed something) which could be useful for my issue or I have to implement all things from scratch, maybe using already outdated gems/libs ?
Another thing I was thinking, maybe this task better to solve on client side using javascript libraries?
If you to try implement contacts importer in a do-it-youself way, the first goal will be proper learn OAuth2 and all the 4 authentication flows. I like this blog post explanation.
Then if you want to use a client-side-only solution for OAuth2, you'll need to use the Implicit flow.
For Google Contacts, you can find Implicit flow documentation here.
Disclaimer: I work for CloudSponge, and I'm a big fan of free/open-source solutions too. I even use Linux as my desktop :)

How can I access Gmail's native API?

I would like to access Gmail's native API. Eg,
create a search folder
tag messages
other gmail-specific actions.
There's this similar question, however the question asker seems happy with developing contextual gadgets rather than actually accessing a user's email.
In before anyone mentions: IMAP and POP are generic, non search based protocols and do not provide full access to gmail. Neither gmail.com, nor any of the official Gmail native apps, use IMAP and POP.
Most webmail services have private, non-IMAP/POP APIs and protocols, eg, hotmail (back when it existed used HTTPMail which was reverse engineered and implemented by hotwayd).
I could run Android gmail with a proxy and attempt to reverse engineer the Gmail protocol itself, but I suspect others have had the same need in the past and may already have a solution.
I did find a list of client of Gmail clients on Gmail Agent API but they don't seem maintained past 2004.
Android's Gmail app is using Google Cloud Messaging (GCM) to push email messages/notifications and sync with the phone. I think that’s “the API” you are looking for. The bad news is that it is obviously very well protected.
You can get started for free with GCM's JSON REST API and use it for your push messaging projects, but forget about using it for your Gmail in the same fashion Google does. The only option for getting a similar efficiency would be using IMAP's IDLE extension, which uses also push.
Focusing on what you need, I think there are decent solutions for the use cases you have listed in your question… You could use a [**Google App Script**][4] or libs like [**GMail for Python**][5], which seems a valid option to me... from the [**GMail for Python GitHub**][6]:
Features
Search emails
Read emails
Emails: label, archive, delete, mark as read/unread/spam, star
Manage labels
If you are developing an Android mobile app Gmail Public Labels API could also be of your interest...
Hope it helps...
EDIT: Google just introduced its GMAIL API
Update June 2014: Google have announced access to the native gmail API.
The Gmail API gives you flexible, RESTful access to the user's inbox,
with a natural interface to Threads, Messages, Labels, Drafts, and
History. From the modern language of your choice, your app can use the
API to add Gmail features like:
Read messages from Gmail
Send email messages
Modify the labels applied to messages and threads
Search for specific messages and threads
https://developers.google.com/gmail/api/

Access to GMail mailbox content with google-api

Is there a way to access a Gmail Mailbox using the google-api? I'm trying to do this from command line using Java FWIW.
I already have code in place that achieves this via IMAP so that is not what I'm looking for.
You can access GMAIL IMAPS and SMTP using XOAUTH authentication, see here :
https://developers.google.com/gmail/xoauth2_protocol
It is not really the google-api-java-client, it is plain IMAP/SMTP but authentication is OAUTH2.
After going through the Google API once again and considering this question did not get an answer in the past 6 days, I guess it is safe to say there is no other way aside from IMAP/S.
NOTE:
This question was initiated because I was told by numerous people that a certain Google API was available and preferable for this purpose. It seems they were all informed by the same person who was not able to show me his source of information and agreed that according to the documentation IMAP indeed is the only API available as of now.

Testing Google's ClientLogin

I have a WPF form that uses ClientLogin to log a user into their Google account.
Specifically, I would like to test my CAPTCHA handling routing. I can't seem to get my account to generate a CAPTCHA.
Does anyone have any suggestions on how to reliably get the Google ClientLogin to ask for a CAPTCHA challenge for testing?
I've just spent quite a while trying to do exactly the same thing.
I found the answer here:
http://roobasoft.com/blog/2008/09/20/force-googles-clientlogin-to-require-a-captcha/
Basically you have to spam the ClientLogin service with bad credentials for a valid user email until it responds with a captcha request.
The page above provides a ruby script to do this, implement in a language of your choice!
cheers,
Pete

can Yahoo and Hotmail contacts api be used without leaving the site?

I might be missing something but I'm trying to implement a contacts retrieval mechanism akin to the one that is offered by Google for Yahoo and Hotmail. Both APIs seem to require the user to actually go to their sites to log in. The documentation is really convoluted for both. I was hoping someone has done this and can point me to a simple way (if there is one) to allow the user to log in directly in my app and then for me to go and fetch their contacts for them (preferably in XML, but JSON would also do nicely).
I currently have a Perl script that goes and gets the gmail stuff and works very nicely. I was (maybe wildly optimistically) hoping that Yahoo and Microsoft would have similarly useful mechanisms.
Check out Open Inviter: http://openinviter.com. It has Yahoo, Hotmail, and many more :)
Seems http://openinviter.com domain is no more. There are few other providers available in market out of which I liked https://socialinviter.com, give it a try.

Resources