Building this rails app I studied the omniauth flow, hope it's useful