Jump to content
We've recently updated our Privacy Statement, available here ×
  • Creating the Data Adapter in Jaspersoft Studio using the MongoDB DataBase


    Prasad B
    • Features: Data Sources Version: v8.2.0 Product: Jaspersoft® Studio

    In the MongoDB database, it uses two different types of authentication:
    a) SCRAM-SHA-1
    b)SCRAM-SHA-256

     

    If the MongoDB database is not using any of the above authentication methods, users can easily create any data adapter without any issue.


    If the database has authentication and users are trying to create the data adapter using the normal approach, then they are getting the below error:
    ===
    Caused by: com.mongodb.MongoCommandException: Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server ...
    ===

    On the database side, when we checked the logs, we could see the below error:
    ===
    2023-09-15T12:16:39.701+0200 I  ACCESS   [conn2232554] SASL SCRAM-SHA-256 authentication failed for ...
    ==

    To successfully authenticate a connection by using a username and password with SCRAM-SHA-256 or SCRAM-SHA-1, the username must be defined in the authentication database. The default authentication database is the admin database.


    Please refer to the below link for more details:
    https://www.mongodb.com/docs/drivers/csharp/current/connection-troubleshooting/


    So, to overcome this issue, we have to explicitly define the authentication mechanism and authentication database (source) in the connection string:
        eg. mongodb://localhost:27017/Jasper_Demo?authMechanism=SCRAM-SHA-256&authSource=admin    


    Once the above-mentioned things are properly defined, users should be able to create the data adapters in the Jaspersoft Studio.

     

    Ref Case: #02207499


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...