Slightly modified suggestion of Brandon Tilley:
# config/routes.rb
match '/auth/:provider/callback' => 'sessions#create'
match 'auth/*rest' => 'application#omniauth'
match '*uri' => 'posts#index'
# app/controllers/application_controller.rb
def omniauth
render text: 'Authentication', status: 404
end