@@ -42,49 +42,63 @@ To use the code examples on this page, replace these placeholders with your own
4242Using GSSAPI Authentication in Your Application
4343-----------------------------------------------
4444
45- To configure the MongoDB server to use Kerberos, see the
46- :manual:`server Kerberos documentation
45+ To configure {+mdb- server+} to use Kerberos, see the
46+ :manual:`{+mdb- server+} Kerberos documentation
4747</tutorial/control-access-to-mongodb-with-kerberos-authentication/>`.
4848
49- To use the Kerberos authentication mechanism with the Ruby MongoDB driver,
49+ To use the Kerberos authentication mechanism with the {+ driver-short+} ,
5050you must install and load the `mongo_kerberos <https://rubygems.org/gems/mongo_kerberos>`__
5151library. To do so, add the following lines to your ``Gemfile``:
5252
5353.. code-block:: ruby
5454
55- gem 'mongo', '~> 2'
56- gem 'mongo_kerberos', '~> 2'
55+ gem 'mongo', '~> 2'
56+ gem 'mongo_kerberos', '~> 2'
5757
5858Then, add the following lines to your application code:
5959
6060.. code-block:: ruby
6161
62- require 'mongo'
63- require 'mongo_kerberos'
64-
65- If using Kerberos authentication with **MRI**, you must establish a Kerberos
66- session to the driver. This session is used by the driver to prove the user's identity to
67- the server. You must ensure that the host system is
68- configured for Kerberos authentication. To learn more about configuring the host system
69- to use Kerberos, see the `Kerberos documentation
70- <https://web.mit.edu/kerberos/krb5-latest/doc/admin/install_clients.html>`__
71- or your operating system documentation for details. Use the `kinit utility
72- <https://web.mit.edu/kerberos/krb5-latest/doc/user/user_commands/kinit.html>`__
62+ require 'mongo'
63+ require 'mongo_kerberos'
64+
65+ .. note::
66+
67+ When using Kerberos authentication, you must specify the fully qualified domain name
68+ (FQDN) of the host.
69+
70+ The following sections describe how to use Kerberos authentication with Ruby MRI and
71+ JRuby.
72+
73+ Using Kerberos Authentication with Ruby MRI
74+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75+
76+ If you're using Kerberos authentication with **Ruby MRI**, you must perform the following
77+ steps:
78+
79+ - Establish a Kerberos session on the driver. The driver uses this session to prove the user's identity to
80+ the server.
81+
82+ - You must ensure that the host system is
83+ configured for Kerberos authentication. To learn more about configuring the host system
84+ to use Kerberos, see the `Kerberos documentation <https://web.mit.edu/kerberos/krb5-latest/doc/admin/install_clients.html>`__
85+ or your operating system documentation for details.
86+
87+ Use the `kinit utility <https://web.mit.edu/kerberos/krb5-latest/doc/user/user_commands/kinit.html>`__
7388to establish a Kerberos session.
7489
75- If using Kerberos authentication with **JRuby**, you can externally establish the Kerberos
76- session to the driver using the process described above for MRI. Alternatively, you can directly
77- provide the password to the driver by using client configuration. You can also provide the
90+ Using Kerberos Authentication with JRuby
91+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92+
93+ If you're using Kerberos authentication with **JRuby**, you can externally establish the Kerberos
94+ session to the driver by using the process described above for MRI. You can also provide the
7895path to a keytab file by storing the configuration in the ``java.security.auth.login.config`` system property.
79- If using JRuby, you must configure the Java Runtime Environment to use Kerberos. To learn more, see the
80- `MongoDB Java Driver Kerberos documentation
81- <https://mongodb.github.io/mongo-java-driver/4.0/driver/tutorials/authentication/#gssapi>`_
96+ You must also configure the Java Runtime Environment to use Kerberos. To learn more, see the
97+ :driver:`MongoDB Java Driver Kerberos documentation </java/sync/current/fundamentals/enterprise-auth/#kerberos--gssapi->`
8298for more information.
8399
84- .. note::
85-
86- Per the server Kerberos documentation, you must specify the FQDN of the host
87- running MongoDB when using Kerberos authentication.
100+ Kerberos Authentication Example
101+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88102
89103Select the :guilabel:`Connection String` or :guilabel:`Client Options` tab to
90104see the corresponding syntax for connecting to MongoDB with Kerberos authentication:
@@ -111,8 +125,8 @@ see the corresponding syntax for connecting to MongoDB with Kerberos authenticat
111125
112126.. note::
113127
114- If you use a connection string to connect to MongoDB, ensure that you to percent-encode any
115- special characters that appear in the username.
128+ If you use a connection string to connect to MongoDB, ensure that you percent-encode any
129+ special characters that appear in the username.
116130
117131API Documentation
118132-----------------
0 commit comments