PHPackages                             prolificinteractive/simplesamlphp-module-mongo - 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-mongo

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

prolificinteractive/simplesamlphp-module-mongo
==============================================

A SimpleSAMLphp module to provide a SimpleSAML\_Store implementation for MongoDB.

1.0.7(8y ago)13.0k2MITPHPPHP ^5.4

Since Dec 8Pushed 7y ago25 watchersCompare

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

READMEChangelog (3)Dependencies (2)Versions (6)Used By (0)

SimpleSAMLphp Mongo Module
==========================

[](#simplesamlphp-mongo-module)

[![Travis build status](https://camo.githubusercontent.com/2aaf41319bf322b5289ea2b4ef3a2b89ecd0c9d5c8036fa33fc62ce693b2f1aa/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f70726f6c69666963696e7465726163746976652f73696d706c6573616d6c7068702d6d6f64756c652d6d6f6e676f2e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/prolificinteractive/simplesamlphp-module-mongo)

The mongo module is an implementation of a SimpleSAMLphp (SSP) data store.

Features
--------

[](#features)

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

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

[](#requirements)

PHP 5.4 through 5.6

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

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

[Mongo PHP extension](http://php.net/manual/en/book.mongo.php)

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

[](#installation)

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

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

```

This command will add `prolificinteractive/simplesamlphp-module-mongo` 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 [Mongo extension PHP Manual](http://php.net/manual/en/mongo.manual.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/mongo` 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

Popularity19

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~21 days

Total

3

Last Release

3037d ago

PHP version history (2 changes)1.0.5PHP ^5.3.0

1.0.7PHP ^5.4

### Community

Maintainers

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

![](https://avatars.githubusercontent.com/u/273362?v=4)[Photis Patriotis](/maintainers/ppatriotis)[@ppatriotis](https://github.com/ppatriotis)

![](https://www.gravatar.com/avatar/9c01cc981ecd301e2b9d6646d13140010d070abd2381ae17201c2db5f09b823b?d=identicon)[prolificphotis](/maintainers/prolificphotis)

---

Top Contributors

[![prolificchrisb](https://avatars.githubusercontent.com/u/30358577?v=4)](https://github.com/prolificchrisb "prolificchrisb (27 commits)")

---

Tags

modulesmongodbphpsimplesamlphpsimplesamlphp-modulestoremongodbmodulesstoresimplesamlphp

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)
