Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

MongoDB is an open source, high-performance, schema-free, document-oriented database written in the C++ programming language.

...

note

This plugin has not been tested by any third party. If you try it out, please let me know if it works for you. Contact information at the bottom.

Installation and configuration

...

Code Block
git clone git://github.com/UnitedID/shibboleth-idp-mongodb-connector.git

Tarballs

mongodb-connector-1.0.91-src.zip
mongodb-connector-1.0.91-src.tar.gz

Build from source

Binary

...

Code Block
 $ mvn clean package

Binary

mongodb-connector-1.0.1-bin.zip
mongodb-connector-1.0.91-bin.tar.gz

Installation

Unpack mongodb-connector-1.0.91-bin.*.

Code Block
cp mongodb-connector-1.0.91/lib/*.jar $IDP_INSTALL_DIR/lib

...

Code Block
    <!-- ========================================== -->
    <!--      Data Connectors                       -->
    <!-- ========================================== -->

    <!-- Mongodb connector -->
    <resolver:DataConnector id="myMongo" xsi:type="uid:MongoDbDataConnector"
                            mongoDbName="your_database_name"
                            mongoCollection="your_collection_name">

      <!-- Database server to connect to, multiple entries allowed for use with master/slave or replica sets -->                      
      <uid:MongoHost host="server1.example.com" port="27017" />
      <!-- 
      <uid:MongoHost host="server2.example.com" port="27017" />
      <uid:MongoHost host="server3.example.com" port="27017" />
      -->

      <!-- The database query in JSON format -->
      <uid:QueryTemplate>
        <![CDATA[
            { 'userNameusername' : '$requestContext.principalName' }
        ]]>
      </uid:QueryTemplate>
      
      <!-- Example attribute mappings between a mongodb keyfield to attributeID -->
   -->   <!--
      <uid:AttributeMap mongoKey="username" attributeID="uid" />
      <uid:AttributeMap mongoKey="email" attributeID="mail" />
      -->
      <!-- Example how to map embedded HashMap fields to an attributeID -->
      <!--
      <uid:AttributeMap mongoKey="address">
 <!--       <uid:AttributeMapValueMap mongoKey="userNameaddress1" attributeID="uidhomePostalAddress" />
        <uid:AttributeMapValueMap mongoKey="emailzip" attributeID="mailpostalCode" /> 
      </uid:AttributeMap>
      -->
    </resolver:DataConnector>

...

Limitations

Currently only 1 support one level deep JSON structures are parsed into attributes, the rest is ignoredembedded documents.

Bugs and comments

Send bugs and comments to stefan@unitedid.org.