By David Patrick
Troubleshooting tips for using Rails with Auth0.We recommend that you log in to follow this quickstart with examples configured for your account.Troubleshooting
The following are troubleshooting topics that you might run into when using the Rails quickstart.Using a reverse proxy
Theredirect_uri parameter that OmniAuth generates when redirecting to login is based on the Host header that is passed to Rails. This can cause incorrect callback URLs to be passed when using this strategy (and OmniAuth in general) with a reverse proxy. You can adjust the host used by OmniAuth with the following snippet:
ActionController::InvalidAuthenticityToken
This is likely caused by a missing CSRF token needed to POST the login request. If you inspect the login button in your browser, you should see something like this:<head> element for the page, you should have CSRF meta tags like these:
ActionDispatch::Cookies::CookieOverflow
This error means that a cookie session is being used and because the whole profile is being stored, it overflows the max-size of 4 kb. If you are unable to access the user profile, or you get an error similar toNoMethodError, undefined method '[]' for nil:NilClass, try using In-Memory store for development.
Go to /config/initializers/session_store.rb (or create it if it does not exist) and add the following:
/config/environments/development.rb and add the following:
SSL Issues
Under some configurations, Ruby may not be able to find certification authority certificates (CA certs). Download the CA certs bundle to the project directory:config/initializers/fix_ssl.rb:
“failure message=invalid_credentials”
This issue doesn’t occur when working locally but may happen in a staging or production environment. The error message may be displayed as:config/environments/staging.rb or production.rb:
http://www.example.com with the actual URL you’ll be using in your application.
Edit on GitHub