intridea/omniauth — Issue #585: Simple Dynamic Paths
Author: mbleigh
Created: 2012-03-06 04:39:53+00:00
State: open

A feature that has been requested (and implemented by others) is the ability to specify "dynamic" paths. I think that using a regular expression matcher or other forms of "route-like" behavior are simply too heavy for OmniAuth. However, I do want to support more powerful custom pathing for OmniAuth so here's my proposal:

The `:request_path` and `:callback_path` options (as well as any additional path options specified by strategy gems) should take a lambda in addition to a string and consider themselves on the respective path for a provider if the lambda evaluates truthily. For example:

```ruby
use OmniAuth::Builder do
use :developer, :request_path => lambda{|env| env['RACK_ENV'] == 'development' && env['PATH_INFO'].include?('/auth') }
end
```