Skip to content

Commit 853ccdd

Browse files
p-mongop
authored andcommitted
RUBY-1734 Update accepted auth mechanisms in documentation (#1269)
1 parent a1bd698 commit 853ccdd

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

docs/tutorials/ruby-driver-authentication.txt

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,35 @@ MongoDB, see the :manual:`SASL/LDAP tutorial in the MongoDB Manual
141141
ssl_cert: '/path/to/client.pem',
142142
ssl_ca_cert: '/path/to/ca.pem' )
143143

144+
.. _kerberos:
145+
144146
Kerberos (GSSAPI) mechanism
145147
```````````````````````````
146148
*Requires MongoDB Enterprise Edition v2.4 or greater.*
147149

148150
MongoDB Enterprise Edition v2.4+ supports Kerberos authentication.
149151

152+
To use Kerberos authentication from Ruby,
153+
`mongo_kerberos <https://rubygems.org/gems/mongo_kerberos>`_ must be
154+
installed. Add to your ``Gemfile``:
155+
156+
.. code-block:: plain
157+
158+
gem 'mongo'
159+
gem 'mongo_kerberos'
160+
161+
... and in your application:
162+
163+
.. code-block:: ruby
164+
165+
require 'mongo'
166+
require 'mongo_kerberos'
167+
168+
To use Kerberos in the Ruby driver with **MRI**, create a
169+
ticket-granting ticket using ``kinit``. See
170+
`this documentation <http://linux.die.net/man/1/kinit>`_ for more
171+
information.
172+
150173
To use Kerberos in the Ruby driver with **JRuby**, do the following:
151174

152175
1. Specify several system properties so that the underlying GSSAPI Java
@@ -158,12 +181,6 @@ To use Kerberos in the Ruby driver with **JRuby**, do the following:
158181
2. Either provide a password OR set the 'java.security.auth.login.config'
159182
system property to a config file that references a keytab file.
160183

161-
To use Kerberos in the Ruby driver
162-
with **Matz's Ruby Interpreter (MRI)**, create a
163-
ticket-granting ticket using ``kinit``. See
164-
`this documentation <http://linux.die.net/man/1/kinit>`_ for more
165-
information.
166-
167184
For more information about deploying MongoDB with Kerberos
168185
authentication, see the :manual:`manual
169186
</tutorial/control-access-to-mongodb-with-kerberos-authentication/>`.

docs/tutorials/ruby-driver-create-client.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,17 @@ Ruby Options
248248

249249
* - ``:auth_mech``
250250
- Specifies the authenticaion mechanism to use. Can be one of:
251-
``:mongodb_cr``, ``:mongodb_x509``, ``:plain``, ``:scram``.
251+
``:gssapi``, ``:mongodb_cr``, ``:mongodb_x509``, ``:plain``,
252+
``:scram``, ``:scram256``. GSSAPI (Kerberos) authentication
253+
:ref:`requires additional dependencies <kerberos>`.
252254
- ``Symbol``
253-
- MongoDB 3.0 and later: ``:scram`` if user credentials
254-
are supplied but an ``:auth_mech`` is not. 2.6 and earlier:
255-
``:mongodb_cr``
255+
- If user credentials are not supplied, ``nil``. If user credentials
256+
are supplied, the default depends on server version.
257+
MongoDB 4.0 and later: ``:scram256`` if user credentials correspond
258+
to a user which supports SCRAM-SHA-256 authentication, otherwise
259+
``:scram``.
260+
MongoDB 3.0-3.6: ``:scram``.
261+
MongoDB 2.6: ``:mongodb_cr``
256262

257263
* - ``:auth_mech_properties``
258264
- Provides additional authentication mechanism properties.
@@ -414,7 +420,7 @@ Ruby Options
414420
- An array of OpenSSL::X509::Certificate representing the certificate authority certificates used to
415421
validate certs passed from the other end of the connection. One of :ssl_ca_cert, :ssl_ca_cert_string or
416422
:ssl_ca_cert_object (in order of priority) is required for :ssl_verify.
417-
- ``Array<OpenSSL::X509::Certificate>``
423+
- ``Array< OpenSSL::X509::Certificate >``
418424
- none
419425

420426
* - ``:ssl_ca_cert_string``

0 commit comments

Comments
 (0)