Creating Signed Cookies in Capybara

I struggled with this for a while, but I finally got it. Backstory I have a series of Rails applications that authenticates through a single OAuth provider app. After authenticating successfully, the OAuth provider creates a multi-domain signed cookie that can be read by all of the apps, so the user will only have to authenticate once. It’s sort of a Single Sign On (SSO) solution that our team thought of a year ago....

September 24, 2015 · 2 min · 303 words

How to allow approved mobile applications to authenticate seamlessly inside OAuth 2.0

I have an existing API server built with Rails, Devise, and the Doorkeeper gem. There’s also a mobile app that wants to use the API for authentication. By default, what will happen is that the client (or mobile app in this case) is going to be redirected to the server’s sign in page and then back to the client. This kind of flow is fine if you’re in a web browser....

December 17, 2014 · 3 min · 433 words

Polymorphic Associations in Rails 3.2

I have recently transferred to a new job. I am now working as a Ruby on Rails developer for TwitMusic. Before I go on about promoting my new employer (which I won’t do for the sake of this article), I would like to point out that I am being trained for the position before I get involved with the production code. For the first part of my training, my employer gave me a set of problems about Ruby on Rails that I have to solve on my own....

March 2, 2012 · 5 min · 874 words