Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Without seeing your entire controller, I can't be sure, but I recently encountered a similar problem with OmniAuth. Here are the two things that worked for me:</p> <p>Description:</p> <ol> <li>There is a virtual host for internalserver.com.</li> <li><p>The virtual host has two apps deployed within it as follows:</p> <pre><code>#/etc/httpd/conf.d/ssl.conf &lt;VirtualHost _default_:443&gt; ServerName internalserver.com:443 DocumentRoot /var/www/html/sites &lt;Directory /var/www/html/sites&gt; AllowOverride all Options -Multiviews &lt;/Directory&gt; # Stable App &lt;Directory /var/www/html/sites/stable&gt; RailsBaseURI /stable RackBaseURI /stable Options -MultiViews RailsEnv production &lt;/Directory&gt; # Beta App &lt;Directory /var/www/html/sites/beta&gt; RailsBaseURI /beta RackBaseURI /beta Options -MultiViews RailsEnv development &lt;/Directory&gt; # SSLStuff ... &lt;/VirtualHost&gt; </code></pre></li> <li><p>The output of <code>ls -al /var/www/html/sites</code>:</p> <pre><code>drwxr-xr-x. 14 apache apache 4096 Feb 6 19:05 app drwxr-xr-x. 14 apache apache 4096 Feb 9 18:15 app_beta lrwxrwxrwx. 1 root root 32 Feb 6 00:00 beta -&gt; /var/www/html/sites/app_beta/public lrwxrwxrwx. 1 root root 32 Feb 6 00:00 stable -&gt; /var/www/html/sites/app/public </code></pre></li> </ol> <p>The two steps I had to take to configure OmniAuth to work correctly:</p> <ol> <li><p>The <code>OmniAuth.config.full_host</code> setting must be set with the sub-directory:</p> <pre><code>#config/initializers/omniauth.rb Rails.application.config.middleware.use OmniAuth::Builder do ... end # Add this line OmniAuth.config.full_host = "https://internalserver.com/beta" # You could also do something dynamic like: # OmniAuth.config.full_host = "#{Settings.host.base_url.gsub(/\/$/, '')}" </code></pre></li> <li><p>For some reason, the named routes did not work when setting up the signin/signout links. I had to hardcode <code>&lt;a href="/auth/&lt;my-provider&gt;"&gt;Click here to log in&lt;/a&gt;</code> instead of using <code>&lt;%= link_to "Click here to log in", signin_path %&gt;</code>. I don't know why that is, but you could try that. </p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload