<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:58:14 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-2853] Java MongoDB 3.6.1 Driver Authenticate Command</title>
                <link>https://jira.mongodb.org/browse/JAVA-2853</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;I was attempting to perform a db.auth() or authenticate command through the driver 3.6.1&#160;and got the following error.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;&#160;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;Error: &lt;/font&gt;&lt;ins&gt;&lt;font color=&quot;#0066cc&quot;&gt;com.mongodb.MongoCommandException&lt;/font&gt;&lt;/ins&gt;&lt;font color=&quot;#FF0000&quot;&gt;: Command failed with error 2: &apos;Challenge-response authentication using getnonce and authenticate commands is disabled.&apos; on server maas-gt-d4-u0038.nam.nsroot.net:37017. The full response is { &quot;ok&quot; : 0.0, &quot;errmsg&quot; : &quot;Challenge-response authentication using getnonce and authenticate commands is disabled.&quot;, &quot;code&quot; : 2, &quot;codeName&quot; : &quot;BadValue&quot; }&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;&#160;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;My Code&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;&#160;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#1f497d&quot;&gt;mongodb://&amp;lt;user&amp;gt;:&amp;lt;pwd&amp;gt;@maas-gt-d4-u0038.nam.nsroot.net:37017/?ssl=true&amp;amp;authSource=admin&amp;amp;sslInvalidHostNameAllowed=true&amp;amp;authMechanism=SCRAM-SHA-1&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;&#160;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;&#160;&#160;&#160;&#160;&#160;&#160; MongoDatabase &lt;/font&gt;&lt;font color=&quot;#6a3e3e&quot;&gt;mongoDB&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt; = &lt;/font&gt;&lt;em&gt;&lt;font color=&quot;#0000c0&quot;&gt;mongoClient&lt;/font&gt;&lt;/em&gt;&lt;font color=&quot;#000000&quot;&gt;.getDatabase(&lt;/font&gt;&lt;font color=&quot;#6a3e3e&quot;&gt;databaseName&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;);&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;&#160;&#160;&#160;&#160;&#160;&#160; Document &lt;/font&gt;&lt;font color=&quot;#6a3e3e&quot;&gt;doc&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt; = &lt;/font&gt;&lt;font color=&quot;#6a3e3e&quot;&gt;mongoDB&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;.runCommand(NativeAuthenticationHelper.&lt;em&gt;getNonceCommand&lt;/em&gt;());&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;&#160;&#160;&#160;&#160;&#160;&#160; BsonDocument &lt;/font&gt;&lt;font color=&quot;#6a3e3e&quot;&gt;auth&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt; = NativeAuthenticationHelper.&lt;em&gt;getAuthCommand&lt;/em&gt;(&lt;/font&gt;&lt;font color=&quot;#2a00ff&quot;&gt;&amp;lt;my user&amp;gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;, &lt;/font&gt;&lt;font color=&quot;#2a00ff&quot;&gt;&amp;lt;my password&amp;gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;.toCharArray(), &lt;/font&gt;&lt;font color=&quot;#6a3e3e&quot;&gt;doc&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;.getString(&lt;/font&gt;&lt;font color=&quot;#2a00ff&quot;&gt;&quot;nonce&quot;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;));&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;&#160;&#160;&#160;&#160;&#160;&#160; Document &lt;/font&gt;&lt;font color=&quot;#6a3e3e&quot;&gt;res&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt; = &lt;/font&gt;&lt;font color=&quot;#6a3e3e&quot;&gt;mongoDB&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;.runCommand(&lt;/font&gt;&lt;font color=&quot;#6a3e3e&quot;&gt;auth&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;);&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#000000&quot;&gt;I am able to connect to the MongoDB instance with that string from my local Tomcat application. SCRAM-SHA-1 is being used.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;

&lt;p&gt;Preeti Gupta&lt;/p&gt;</description>
                <environment></environment>
        <key id="540048">JAVA-2853</key>
            <summary>Java MongoDB 3.6.1 Driver Authenticate Command</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="preeti3.gupta@citi.com">Preeti Gupta</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 May 2018 06:49:55 +0000</created>
                <updated>Wed, 11 Sep 2019 19:10:02 +0000</updated>
                            <resolved>Mon, 7 May 2018 13:03:03 +0000</resolved>
                                                                    <component>Authentication</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1884431" author="jeff.yemin" created="Mon, 7 May 2018 13:01:28 +0000"  >&lt;p&gt;The commands you&apos;re using (getNonce, authenticate) are for the deprecated MONGODB-CR authentication mechanism, not SCRAM-SHA-1.&#160; I suspect that your MongoDB server is configured to not accept MONGODB-CR, which would explain why authentication works when you provide the credentials to the MongoClient constructor, but fails when you attempt to explicitly authenticate.&#160; See &lt;a href=&quot;https://docs.mongodb.com/manual/core/security-mongodb-cr/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the MONGODB-DR documentation&lt;/a&gt;&#160;for more information.&lt;/p&gt;


&lt;p&gt;Also, note that &lt;tt&gt;NativeAuthenticationHelper&lt;/tt&gt; is internal and documented as not part of the public API.&#160;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htofsn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>