omniauth-saml icon indicating copy to clipboard operation
omniauth-saml copied to clipboard

Wrong OmniAuth configuration. If your are getting this exception... message

Open vmvwebworks opened this issue 8 years ago • 8 comments

After configure, i tried to start the server and said this:

Wrong OmniAuth configuration. If you are getting this exception, it means that either:

1) You are manually setting OmniAuth.config.path_prefix and it doesn't match the Devise one
2) You are setting :omniauthable in more than one model
3) You changed your Devise routes/OmniAuth setting and haven't restarted your server my-profile-configuration/gems/devise-3.2.4/lib/devise/rails/routes.rb:471:in `set_omniauth_path_prefix!

I have this on my user model devise :registerable, :confirmable, :recoverable, :rememberable, :trackable, :validatable, :database_authenticatable, :omniauthable, :omniauth_providers => [:saml]

I follow the instructions include when it says to follow omniauth facebook example and got this. What would be done?

vmvwebworks avatar Feb 24 '17 20:02 vmvwebworks

Hello,

Could you please also post the devise_for statement from your config/routes.rb file?

ilikepi avatar Feb 24 '17 21:02 ilikepi

Of course

devise :registerable, :confirmable, :recoverable,
         :rememberable, :trackable, :validatable, :database_authenticatable, :omniauthable, :omniauth_providers => [:saml]

vmvwebworks avatar Feb 27 '17 11:02 vmvwebworks

http://stackoverflow.com/questions/24574094/deviseomniauth-routes-versioning

The solution that uncomment the line at the bottom of the file, it says: # config.omniauth_path_prefix = '/my_engine/users/auth' and add your route

vmvwebworks avatar Feb 27 '17 11:02 vmvwebworks

Hi @vmvwebworks,

Can you please confirm that the solution in that Stack Overflow post resolved your issue? Or are you still encountering the error?

ilikepi avatar Feb 28 '17 17:02 ilikepi

Yes, it solved, at least for now. I still developing the same feature, i will notify here if i found more issues.

vmvwebworks avatar Feb 28 '17 17:02 vmvwebworks

thanks for this @vmvwebworks , i've encountered same issue and couldn't find any solution until now. would be best if we could add this to readme

dwoznicka avatar Oct 12 '17 09:10 dwoznicka

The fix is nice but as the config file is global than it doesn't work when using multiple devise model and not all are on the namespace. Any ideas on how to achieve this path fix for only one devise model/route ?

Romain-C avatar Sep 19 '18 20:09 Romain-C

We are currently running into this issue too. Any updates or potential workarounds?

motazbalghonaim avatar Nov 30 '21 21:11 motazbalghonaim