You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[![Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0][🖼️galtzo-i]][🖼️galtzo-discord][![ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5][🖼️ruby-lang-i]][🖼️ruby-lang][![omniauth-ldap Logo by Aboling0, CC BY-SA 4.0][🖼️omniauth-ldap-i]][🖼️omniauth-ldap]
30
+
[![Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0][🖼️galtzo-i]][🖼️galtzo-discord][![ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5][🖼️ruby-lang-i]][🖼️ruby-lang][![omniauth Logo (presumed to be) by tomeara, (presumed to be) MIT License][🖼️omniauth-i]][🖼️omniauth]
`if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][🖼️galtzo-discord], as I may have missed the [discord notification][🖼️galtzo-discord].
44
44
@@ -81,6 +81,50 @@ use OmniAuth::Strategies::LDAP,
81
81
82
82
All of the listed options are required, with the exception of `:title`, `:name_proc`, `:bind_dn`, and `:password`.
83
83
84
+
### TLS certificate verification
85
+
86
+
This gem enables TLS certificate verification by default when you use `encryption: "ssl"` (LDAPS / simple TLS) or `encryption: "tls"` (STARTTLS). We always pass `tls_options` to Net::LDAP based on `OpenSSL::SSL::SSLContext::DEFAULT_PARAMS`, which includes `verify_mode: OpenSSL::SSL::VERIFY_PEER` and sane defaults.
87
+
88
+
- Secure by default: you do not need to set anything extra to verify the LDAP server certificate.
89
+
- To customize trust or ciphers, supply your own `tls_options`, which are merged over the safe defaults.
90
+
- If you truly need to skip verification (not recommended), set `disable_verify_certificates: true`.
91
+
92
+
Examples:
93
+
94
+
```ruby
95
+
# Verify server certs (default behavior)
96
+
use OmniAuth::Strategies::LDAP,
97
+
host:ENV["LDAP_HOST"],
98
+
port:636,
99
+
encryption:"ssl", # or "tls"
100
+
base:"dc=example,dc=com",
101
+
uid:"uid"
102
+
103
+
# Use a private CA bundle and restrict protocol/ciphers
# Opt out of verification (NOT recommended – use only in trusted test/dev scenarios)
117
+
use OmniAuth::Strategies::LDAP,
118
+
host:ENV["LDAP_HOST"],
119
+
port:636,
120
+
encryption:"ssl",
121
+
base:"dc=example,dc=com",
122
+
uid:"uid",
123
+
disable_verify_certificates:true
124
+
```
125
+
126
+
Note: Net::LDAP historically defaulted to no certificate validation when `tls_options` were not provided. This library mitigates that by always providing secure `tls_options` unless you explicitly disable verification.
127
+
84
128
## 💡 Info you can shake a stick at
85
129
86
130
| Tokens to Remember |[![Gem name][⛳️name-img]][⛳️gem-name][![Gem namespace][⛳️namespace-img]][⛳️gem-namespace]|
@@ -90,8 +134,8 @@ All of the listed options are required, with the exception of `:title`, `:name_p
90
134
| Works with MRI Ruby 3 |[![Ruby 3.0 Compat][💎ruby-3.0i]][🚎4-lg-wf][![Ruby 3.1 Compat][💎ruby-3.1i]][🚎6-s-wf][![Ruby 3.2 Compat][💎ruby-3.2i]][🚎6-s-wf][![Ruby 3.3 Compat][💎ruby-3.3i]][🚎6-s-wf][![Ruby 3.4 Compat][💎ruby-c-i]][🚎11-c-wf][![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf]|
| Support & Community |[![Join Me on Daily.dev's RubyFriends][✉️ruby-friends-img]][✉️ruby-friends][![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite][![Get help from me on Upwork][👨🏼🏫expsup-upwork-img]][👨🏼🏫expsup-upwork][![Get help from me on Codementor][👨🏼🏫expsup-codementor-img]][👨🏼🏫expsup-codementor]|
93
-
| Source |[![Source on GitLab.com][📜src-gl-img]][📜src-gl][![Source on CodeBerg.org][📜src-cb-img]][📜src-cb][![Source on Github.com][📜src-gh-img]][📜src-gh][![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc]|
94
-
| Documentation |[![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current][![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head][![Maintainer Blog][🚂maint-blog-img]][🚂maint-blog][![GitLab Wiki][📜gl-wiki-img]][📜gl-wiki][![GitHub Wiki][📜gh-wiki-img]][📜gh-wiki]|
137
+
| Source |[![Source on Github.com][📜src-gh-img]][📜src-gh][![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc]|
138
+
| Documentation |[![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current][![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head][![Maintainer Blog][🚂maint-blog-img]][🚂maint-blog][![GitHub Wiki][📜gh-wiki-img]][📜gh-wiki]|
95
139
| Compliance |[![License: MIT][📄license-img]][📄license-ref][![Compatible with Apache Software Projects: Verified by SkyWalking Eyes][📄license-compat-img]][📄license-compat][![📄ilo-declaration-img]][📄ilo-declaration][![Security Policy][🔐security-img]][🔐security][![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct][![SemVer 2.0.0][📌semver-img]][📌semver]|
| Maintainer 🎖️ |[![Follow Me on LinkedIn][💖🖇linkedin-img]][💖🖇linkedin][![Follow Me on Ruby.Social][💖🐘ruby-mast-img]][💖🐘ruby-mast][![Follow Me on Bluesky][💖🦋bluesky-img]][💖🦋bluesky][![Contact Maintainer][🚂maint-contact-img]][🚂maint-contact][![My technical writing][💖💁🏼♂️devto-img]][💖💁🏼♂️devto]|
@@ -105,22 +149,6 @@ Compatible with MRI Ruby 2.0+, and concordant releases of JRuby, and TruffleRuby
### Enterprise Support [](https://tidelift.com/subscription/pkg/rubygems-omniauth-ldap?utm_source=rubygems-omniauth-ldap&utm_medium=referral&utm_campaign=readme)
125
153
126
154
Available as part of the Tidelift Subscription.
@@ -696,8 +724,6 @@ See [CONTRIBUTING.md][🤝contributing].
696
724
697
725
[![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls]
698
726
699
-
[![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov]
700
-
701
727
### 🪇 Code of Conduct
702
728
703
729
Everyone interacting with this project's codebases, issue trackers,
@@ -709,8 +735,6 @@ chat rooms and mailing lists agrees to follow the [![Contributor Covenant 2.1][
709
735
710
736
Made with [contributors-img][🖐contrib-rocks].
711
737
712
-
Also see GitLab Contributors: [https://gitlab.com/omniauth/omniauth-ldap/-/graphs/main][🚎contributors-gl]
713
-
714
738
<details>
715
739
<summary>⭐️ Star History</summary>
716
740
@@ -771,14 +795,20 @@ See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright
771
795
772
796
<ul>
773
797
<li>
774
-
Copyright (c) 2023, 2025 Peter H. Boling, of
798
+
Copyright (c) 2025 Peter H. Boling, of
775
799
<a href="https://discord.gg/3qme4XHNKN">
776
800
Galtzo.com
777
801
<picture>
778
802
<img src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px-blank.svg" alt="Galtzo.com Logo (Wordless) by Aboling0, CC BY-SA 4.0" width="24">
0 commit comments