Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem when using /forum to access discourse #8

Closed
lud0vicb opened this issue Jun 16, 2016 · 1 comment
Closed

problem when using /forum to access discourse #8

lud0vicb opened this issue Jun 16, 2016 · 1 comment

Comments

@lud0vicb
Copy link

lud0vicb commented Jun 16, 2016

hello

my discourse is running behing a nginx proxy. I can access discourse through url like : https://XXX.YYY.ZZ/forum
I had to install nginx on host and to redirect http(s) cnx to 2 sockets in /shared directory. The container's nginx has to listen to those sockets to receive packets.
I had to change the long polling parameter in discourse admin page.

I have a problem with this plugin. When I click on login button, discourse shows me a banner. I have to click on "login whith ldap".
Discourse shows me an other banner : https://xxx.yyy.zz/forum/auth/ldap
I wrote ldap login and password and click on sign in button.
Here is the problem. This redirects me to https://xxx.yyy.zz/auth/ldap/callback. The /forum subdirectory in the url is lost during the redirect. So it does not work.

note : I used this plugin without the /forum hack ; it works perfectly
note2 : I'am able to make it works by adding a this line to nginx conf
rewrite ^/auth/ldap/(.*)$ /forum/auth/ldap/$1 last;

@jonmbake
Copy link
Owner

jonmbake commented Jun 17, 2016

Hey, @lud0vicb. This appears to be an issue with the dependency, omniauth-ldap ie it doesn't provide a way to easily set the callback_path. There is relavent discussion here: omniauth/omniauth-ldap#16 (comment). You might be able to monky patch and hard code in your callback_path like in this comment: omniauth/omniauth-ldap#16 (comment):

module OmniAuth
  module Strategies
    class LDAP
      def request_phase
        OmniAuth::LDAP::Adaptor.validate @options
        f = OmniAuth::Form.new(:title => (options[:title] || "LDAP Authentication"), :url => '/forum/auth/ldap')
        f.text_field 'Login', 'username'
        f.password_field 'Password', 'password'
        f.button "Sign In"
        f.to_response
      end
    end
  end
end

Not sure if that will work or not. The gem is not very well supported... would prefer to use something else.

Let me know how things work out.

Regards,
Jon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants