Authentication mechanism SCRAM-SHA1 with MongoDB 1.0.0

 Authentication mechanism SCRAM-SHA1 with MongoDB 1.0.0

book

Article ID: KB0082903

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for MongoDB 1.0.0

Description

How to authenticate SCRAM-SHA1 with MongoDB 1.0.0

Issue/Introduction

How to authenticate SCRAM-SHA1 with MongoDB 1.0.0

Environment

Install an engineering build "TIB_bwpluginmongodb_1.0.0_HF-001_ENGR-001.zip" to support the authentication mechanism SCRAM-SHA1. 

Resolution

 Authentication mechanism SCRAM-SHA1 with MongoDB 1.0.0
 
  *****************************************************
 MongoDB Side:
 Start MongoDB Server with normal mode as "mongod  --dbpath c:\data"
 Start Mongo client with normal mode as " mongo "
 
 Create user for a database.
 ex: Created user for admin datbase as:
 
  db.createUser(
  {
    user: "admin1",
     pwd: "abc123",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
  }
 )
 
 Authenticate user as  SCRAM-SHA-1 mechanism.
 
 db.auth( {
   user: admin1,
   pwd: abc123,
   mechanism: SCRAM-SHA-1
} )

Stop mongoDb server and client.

Start MongoDb Server with normal mode as "mongod --auth --dbpath c:\data"
Start Mongo client with normal mode as "mongo -u "admin1" -p "abc123" --authenticationDatabase "admin" "
 
BW Side: 
Start Mongo client from BW as.

1). Open MongoDB Connection.

2).  Add Host and port.

3). Add databasename as "admin"  # we have created user for admin. You can use a different database if you have created user and authenticated as SCRAM-SHA-1 mechanism for a differnt database

4). Open security,
     Check SHA credential,
     Add your username and password.
     for above example add username as "admin1" and password as "abc123".

5). Test connection.
**********************************************