Picture of Michael Lee
:wave: Hey hey, I'm @michaelsoolee! I'm a full-stack developer, maker of one too many side projects and dad.

OAuth, whoa

Written on September 18, 2018

As I’m building out the features for public release of ConfsList, I’m trying to integrate OAuth. What OAuth will allow is using your GitHub or Twitter account to sign up and log into ConfsList. This is unnecessary I suppose, but figured it’s a convenience many folks are used to now.

But, whoa.

Setting up OAuth with Devise, which is my authentication solution, is no joke. After reading hours of various articles on how to go about doing it, I think I do see a common pattern to implement OAuth for ConfsList thanks to this article (which looks very similar to dev.to’s setup) and this article.

I’ll probably use the strategy from the first article above, since it abstracts the authentication away from the user model and instead does it against an identity model. Only creating a user if it’s a new identity. It also handles if a user signs up using one OAuth account and then trying to sign up again with another one. Only a single user would be created for this scenario.

I admit, implementing OAuth is a whee over my head, but I think I’ll be able to figure it out in a couple of days.

Stay in touch

Thanks for reading this article. I'd love to stay in touch and share more tips on programming, design and side projects with you. Sign up and I'll send you my articles straight to your email.