{"action":"created","issue":{"url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/25","labels_url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/25/comments","events_url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/25/events","html_url":"https://github.com/apokalipto/devise_saml_authenticatable/issues/25","id":103211058,"number":25,"title":"Devise with :saml_authenticatable AND :database_authenticatable","user":{"login":"marcelotto","id":376888,"avatar_url":"https://avatars.githubusercontent.com/u/376888?v=3","gravatar_id":"","url":"https://api.github.com/users/marcelotto","html_url":"https://github.com/marcelotto","followers_url":"https://api.github.com/users/marcelotto/followers","following_url":"https://api.github.com/users/marcelotto/following{/other_user}","gists_url":"https://api.github.com/users/marcelotto/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelotto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelotto/subscriptions","organizations_url":"https://api.github.com/users/marcelotto/orgs","repos_url":"https://api.github.com/users/marcelotto/repos","events_url":"https://api.github.com/users/marcelotto/events{/privacy}","received_events_url":"https://api.github.com/users/marcelotto/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-26T08:47:35Z","updated_at":"2015-09-11T16:29:56Z","closed_at":"2015-09-11T16:29:56Z","body":"I am working on an application, in which I want to use DeviseSamlAuthenticatable as the primary authentication strategy, but for users without an account at the Identity Provider, also use Devises database_authenticatable strategy to authenticate via application-specific accounts. But when both strategies activated with\r\n\r\n```ruby\r\ndevise :saml_authenticatable, :database_authenticatable \r\n```\r\n\r\nand a single\r\n\r\n```ruby\r\ndevise_for :users\r\n```\r\n\r\nin the routes.rb, I get:\r\n\r\n```\r\nvendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:538:in `add_route': Invalid route name, already in use: 'new_user_session'  (ArgumentError)\r\nYou may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:\r\nhttp://guides.rubyonrails.org/routing.html#restricting-the-routes-created\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1561:in `add_route'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1536:in `decomposed_match'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1534:in `block in decomposed_match'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1419:in `block (2 levels) in member'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:816:in `scope'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1419:in `block in member'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1665:in `with_scope_level'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1415:in `member'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1534:in `decomposed_match'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1517:in `block in match'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1507:in `each'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1507:in `match'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:689:in `map_method'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:650:in `get'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise_saml_authenticatable-1.1/lib/devise_saml_authenticatable/routes.rb:5:in `block in devise_saml_authenticatable'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1198:in `block in resource'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1676:in `block (2 levels) in resource_scope'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:816:in `scope'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1676:in `block in resource_scope'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1665:in `with_scope_level'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1675:in `resource_scope'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:1197:in `resource'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise_saml_authenticatable-1.1/lib/devise_saml_authenticatable/routes.rb:4:in `devise_saml_authenticatable'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:249:in `block (4 levels) in devise_for'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:249:in `each'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:249:in `block (3 levels) in devise_for'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:452:in `with_devise_exclusive_scope'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:248:in `block (2 levels) in devise_for'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:351:in `block in devise_scope'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:940:in `block in constraints'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:816:in `scope'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/mapper.rb:940:in `constraints'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:350:in `devise_scope'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:247:in `block in devise_for'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:223:in `each'\r\n    from vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/lib/devise/rails/routes.rb:223:in `devise_for'\r\n    from config/routes.rb:74:in `block in <top (required)>'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:423:in `instance_exec'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:423:in `eval_block'\r\n    from vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:401:in `draw'\r\n    from config/routes.rb:1:in `<top (required)>'\r\n    from vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'\r\n    from vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'\r\n    from vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'\r\n    from vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:40:in `each'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:16:in `reload!'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'\r\n    from vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/file_update_checker.rb:75:in `call'\r\n    from vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/file_update_checker.rb:75:in `execute'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:27:in `updater'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'\r\n    from /Users/marcel/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'\r\n    from /Users/marcel/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'\r\n    from /Users/marcel/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'\r\n    from /Users/marcel/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'\r\n    from /Users/marcel/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'\r\n    from /Users/marcel/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'\r\n    from /Users/marcel/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'\r\n    from /Users/marcel/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'\r\n    from /Users/marcel/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/railtie.rb:194:in `public_send'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/railtie.rb:194:in `method_missing'\r\n    from config/environment.rb:5:in `<top (required)>'\r\n    from vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'\r\n    from vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'\r\n    from vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'\r\n    from vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'\r\n    from config.ru:3:in `block in <main>'\r\n    from vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `instance_eval'\r\n    from vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `initialize'\r\n    from config.ru:in `new'\r\n    from config.ru:in `<main>'\r\n    from vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:49:in `eval'\r\n    from vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:49:in `new_from_string'\r\n    from vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:40:in `parse_file'\r\n    from vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:299:in `build_app_and_options_from_config'\r\n    from vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:208:in `app'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:61:in `app'\r\n    from vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:336:in `wrapped_app'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:139:in `log_to_stdout'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:78:in `start'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'\r\n    from vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'\r\n    from bin/rails:4:in `require'\r\n    from bin/rails:4:in `<main>'\r\n```\r\n\r\nSince I know it is possible to chain different strategies with Warden, I wonder if and how it is possible to implement this with DeviseSamlAuthenticatable. \r\n\r\nAny help appreciated,\r\nMarcel\r\n"},"comment":{"url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/comments/139591997","html_url":"https://github.com/apokalipto/devise_saml_authenticatable/issues/25#issuecomment-139591997","issue_url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/25","id":139591997,"user":{"login":"adamstegman","id":286694,"avatar_url":"https://avatars.githubusercontent.com/u/286694?v=3","gravatar_id":"","url":"https://api.github.com/users/adamstegman","html_url":"https://github.com/adamstegman","followers_url":"https://api.github.com/users/adamstegman/followers","following_url":"https://api.github.com/users/adamstegman/following{/other_user}","gists_url":"https://api.github.com/users/adamstegman/gists{/gist_id}","starred_url":"https://api.github.com/users/adamstegman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamstegman/subscriptions","organizations_url":"https://api.github.com/users/adamstegman/orgs","repos_url":"https://api.github.com/users/adamstegman/repos","events_url":"https://api.github.com/users/adamstegman/events{/privacy}","received_events_url":"https://api.github.com/users/adamstegman/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T16:29:56Z","updated_at":"2015-09-11T16:29:56Z","body":"I'm going to close this issue, please let me know if there's more to discuss!"}}