PHPackages                             prolificinteractive/simplesamlphp-module-mongodb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. prolificinteractive/simplesamlphp-module-mongodb

ActiveSimplesamlphp-module[Database &amp; ORM](/categories/database)

prolificinteractive/simplesamlphp-module-mongodb
================================================

A SimpleSAMLphp module to provide a SimpleSAML\_Store implementation for MongoDB in PHP 5.5 or higher.

v2.0.1(7y ago)21.6k4MITPHPPHP ^5.5 || ^7.0

Since Dec 8Pushed 7y ago3 watchersCompare

[ Source](https://github.com/prolificinteractive/simplesamlphp-module-mongodb)[ Packagist](https://packagist.org/packages/prolificinteractive/simplesamlphp-module-mongodb)[ RSS](/packages/prolificinteractive-simplesamlphp-module-mongodb/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (2)Versions (9)Used By (0)

SimpleSAMLphp MongoDB Module
============================

[](#simplesamlphp-mongodb-module)

[![Travis build status](https://camo.githubusercontent.com/a8e723d3887014f8a8de65a4bebe861bbf4a96897030856e9cd7e6126e53eb77/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f70726f6c69666963696e7465726163746976652f73696d706c6573616d6c7068702d6d6f64756c652d6d6f6e676f64622e7376673f7374796c653d666c61742d737175617265266272616e63683d6d6173746572)](https://travis-ci.org/prolificinteractive/simplesamlphp-module-mongodb)

This module is an implementation of a SimpleSAMLphp (SSP) data store to add support for the MongoDB PHP library.

Features
--------

[](#features)

- Can be used for backend storage of sessions in MongoDB
- Includes support for replica sets

Requirements
------------

[](#requirements)

PHP 5.5 or higher

[SimpleSAMLphp](https://simplesamlphp.org/)

[MongoDB](https://www.mongodb.com/)

[MongoDB PHP extension](http://php.net/manual/en/book.mongodb.php)

Installation
------------

[](#installation)

If your project manages SSP with [Composer](https://getcomposer.org/) run:

```
php composer.phar require prolificinteractive/simplesamlphp-module-mongodb

```

This command will add `prolificinteractive/simplesamlphp-module-mongodb` to your projects' composer.json file and install the module into SSP's `modules` directory, which relative to your project's root directory is conventionally `vendor/simplesamlphp/simplesamlphp/modules`.

Usage
-----

[](#usage)

Set the `store.type` option in your SSP config file to `mongo:Store`.

Provide your MongoDB connection information to the module by copying the file provided in the `config-templates` directory into SSP's config directory, and setting the following environment variables:

```
DB_MONGODB_HOST
DB_MONGODB_PORT
DB_MONGODB_USERNAME
DB_MONGODB_PASSWORD
DB_MONGODB_DATABASE

```

If your connecting to a replica set, you'll need to set the following environment variables below as well:

```
DB_DEFAULT_CONNECTION   # Must contain the substring "_replica"
DB_MONGODB_REPLICASET
DB_MONGODB_READ_PREFERENCE

```

See the [MongoDB extension PHP Manual](http://php.net/manual/en/set.mongodb.php) for more information about appropriate values for `DB_MONGODB_REPLICASET` and `DB_MONGODB_READ_PREFERENCE`.

Finally, you can enable the module by creating an empty file name `enable` in the `vendor/simplesamlphp/simplesamlphp/modules/mongodb` directory.

**Note:** This module stores PHP session data in the `session` collection.

Contributing to SimpleSAMLphp Mongo Module
------------------------------------------

[](#contributing-to-simplesamlphp-mongo-module)

To report a bug or enhancement request, feel free to file an issue under the respective heading.

If you wish to contribute to the project, fork this repo and submit a pull request.

License
-------

[](#license)

[![prolific](https://camo.githubusercontent.com/d2815b903270b4c68edf4a52c7e753e25e16024bbceb0ceb61d6d3a543600d5b/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f70726f6c696669637369746573746167696e672f6c6f676f732f50726f6c696669635f4c6f676f5f46756c6c5f436f6c6f722e706e67)](https://camo.githubusercontent.com/d2815b903270b4c68edf4a52c7e753e25e16024bbceb0ceb61d6d3a543600d5b/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f70726f6c696669637369746573746167696e672f6c6f676f732f50726f6c696669635f4c6f676f5f46756c6c5f436f6c6f722e706e67)

Copyright (c) 2017 Prolific Interactive

SimpleSAMLphp Mongo Module is maintained and sponsored by Prolific Interactive. It may be redistributed under the terms specified in the [LICENSE](./LICENSE) file.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 68.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~112 days

Total

5

Last Release

2631d ago

Major Versions

1.0.7 → v2.0.02019-02-20

PHP version history (3 changes)1.0.5PHP ^5.3.0

1.0.7PHP ^5.4

v2.0.0PHP ^5.5 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f0fdb55c361a86cecd14ee558dee073cba8b47ad3e0698fba58d8fe905a5f8c6?d=identicon)[prolificchrisb](/maintainers/prolificchrisb)

---

Top Contributors

[![prolificchrisb](https://avatars.githubusercontent.com/u/30358577?v=4)](https://github.com/prolificchrisb "prolificchrisb (28 commits)")[![connorcook](https://avatars.githubusercontent.com/u/5090543?v=4)](https://github.com/connorcook "connorcook (8 commits)")[![jlfalcon](https://avatars.githubusercontent.com/u/1698111?v=4)](https://github.com/jlfalcon "jlfalcon (5 commits)")

---

Tags

mongodbmodulesstoresimplesamlphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/prolificinteractive-simplesamlphp-module-mongodb/health.svg)

```
[![Health](https://phpackages.com/badges/prolificinteractive-simplesamlphp-module-mongodb/health.svg)](https://phpackages.com/packages/prolificinteractive-simplesamlphp-module-mongodb)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[doctrine/mongodb-odm

PHP Doctrine MongoDB Object Document Mapper (ODM) provides transparent persistence for PHP objects to MongoDB.

1.1k23.3M302](/packages/doctrine-mongodb-odm)[friendsofsymfony/elastica-bundle

Elasticsearch PHP integration for your Symfony project using Elastica

1.3k17.2M47](/packages/friendsofsymfony-elastica-bundle)[doctrine/mongodb-odm-bundle

Symfony Doctrine MongoDB Bundle

38418.7M195](/packages/doctrine-mongodb-odm-bundle)[moriony/silex-mongo-provider

Mongo service provider for the Silex framwork.

118.5k](/packages/moriony-silex-mongo-provider)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
