I created an application that allows a user to authenticate in Active Directory using omniauth-ldap. If this is a new user, successful authentication creates a user for them based on information returned from AD. If the user already exists, he simply registers them. Users are not registered for the application, they are simply registered with AD credentials. And I never want the user to log in with the database credentials.
I cannot figure out how to get rid of some routes or change them. For example, if a user visits / sign _in, he gets database authentication. And if the user visits sign_up, they get to the page for registration on the site. I would like users who visited / sign _in to be sent to LDAP login, which is / users / auth / ldap. I think I need to make my own route, but I'm not sure which controller I need to direct the user. And I want the sign_up page to completely disappear.
Right now I have a link that allows users to register using ldap, and the path for this is user_omniauth_authorize_path (: ldap). I'm just not sure how to translate this to something that my config / routes.rb file understands. This is what I have on my routes right now.
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } do get 'sign_in', :to => 'devise/sessions#new', :as => :new_user_session get 'sign_out', :to => 'devise/sessions#destroy', :as => :destroy_user_session end
When I run the rake routes, I donβt see any route for user_omniauth_authorize_path, which I believe is due to the fact that this route is generated during development. Therefore, I think that I need my routes to point to the created controller, but I cannot find the correct path.
source share