[ 
https://issues.apache.org/jira/browse/NIFI-14626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17985103#comment-17985103
 ] 

ASF subversion and git services commented on NIFI-14626:
--------------------------------------------------------

Commit 2c6d5bf142c85a9771e429e391466d14a86bf48a in nifi's branch 
refs/heads/main from Pierre Villard
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=2c6d5bf142 ]

NIFI-14626 Fixed MongoDB authMechanism in Connection String

- Parse and remove authMechanism from input Connection String to avoid errors 
that otherwise require the username and password in the Connection String

This closes #9998

Signed-off-by: David Handermann <[email protected]>


> MongoDBControllerService does not pull credentials correctly from config
> ------------------------------------------------------------------------
>
>                 Key: NIFI-14626
>                 URL: https://issues.apache.org/jira/browse/NIFI-14626
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 2.4.0
>         Environment: NiFi Docker Image: pulled from latest (2.4.0)
>            Reporter: James Coulson
>            Assignee: Pierre Villard
>            Priority: Minor
>         Attachments: Screenshot from 2025-06-05 10-13-36.png
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> When configuring the MongoDBControllerService, trying to validate or enable 
> the service results in a connection test failure with the error 
> "username/password can not be null". This happens when using the connection 
> string that does not contain any credentials (as the credentials are defined 
> in the Database User and Password Property) eg: 
> {code:java}
> mongodb://server:27017/?tls=true&authMechanism=SCRAM-SHA-256 {code}
> Adding the credentials to the connection URI but leaving them blank in the 
> controller properties also triggers this error.
>  
> A workaround found was to add the credentials in the MongoURI property eg:
> {code:java}
> mongodb://username:password@server:27017/?tls=true&authMechanism=SCRAM-SHA-256
>   {code}
> while also specifying them in the properties of the controller.
>  
> Previously worked in 2.2.0 with the credentials defined in controller 
> properties and no credentials in server URI
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to