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

TypeError with discourse 3.0.0.beta16 #71

Closed
loganharbour opened this issue Jan 6, 2023 · 4 comments
Closed

TypeError with discourse 3.0.0.beta16 #71

loganharbour opened this issue Jan 6, 2023 · 4 comments

Comments

@loganharbour
Copy link

loganharbour commented Jan 6, 2023

With 0.6.0 and discourse 3.0.0.beta16, I get the following deprecation warning:

Deprecation warning: please give :encryption option as a Hash to Net::LDAP.new

And the following error:

(ldap) Authentication failure! ldap_error: TypeError, no implicit conversion of Hash into String
Started GET "/auth/failure?message=ldap_error&strategy=ldap" for x.x.x.x at 2023-01-06 23:02:12 +0000
Processing by Users::OmniauthCallbacksController#failure as HTML
  Parameters: {"message"=>"ldap_error", "strategy"=>"ldap"}

I've tried to do into this some but I'm not nearly capable enough. I tried setting :encryption at

base: SiteSetting.ldap_base,
to get rid of the deprecation warning, but still have the conversion error.

If I knew how to get a trace of the error... I'd be glad to contribute to a solution here.

First reported at https://meta.discourse.org/t/jonmbake-discourse-ldap-auth-ldap-plugin-not-working-after-upgrading-discourse-to-3-0-0-beta16/250979.

@Tris20
Copy link

Tris20 commented Jan 7, 2023

Hi logan,

I wonder if updating the net-ldap gem version in the plugin.rb file helps? Looks like something similar was resolved in September last year: ruby-ldap/ruby-net-ldap#408

I can see version 0.17.1(from june) doesn't have this change, so you might have to specify the github path directly.
Here are some examples of how to do that:
https://bundler.io/guides/git.html
https://stackoverflow.com/questions/2823492/install-gem-from-github-branch

Newer versions seem to also make it Ruby 3 compatible.
image

@bdecotte
Copy link
Contributor

bdecotte commented Jan 7, 2023

Good call ! It works 👍
(do not bump omniauth-ldap to 2.0.0 though :
Unable to activate omniauth-ldap-2.0.0, because omniauth-1.9.2 conflicts with omniauth (~> 1.8.1), rubyntlm-0.3.4 conflicts with rubyntlm (~> 0.6.2) )

@jonmbake
Copy link
Owner

jonmbake commented Jan 7, 2023

Glad you found a fix 🎉 Can you submit a pull request with the fix?

@loganharbour
Copy link
Author

Closed by #72

Thanks all!

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

4 participants