PHPackages                             monkdev/monk-id - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. monkdev/monk-id

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

monkdev/monk-id
===============

Integrate Monk ID authentication and single sign-on for apps and websites on the server-side.

v1.1.0(9y ago)19.3kMITPHPPHP &gt;=5.3.0

Since Jan 21Pushed 9y ago19 watchersCompare

[ Source](https://github.com/MonkDev/monk-id-php)[ Packagist](https://packagist.org/packages/monkdev/monk-id)[ Docs](https://github.com/MonkDev/monk-id-php)[ RSS](/packages/monkdev-monk-id/feed)WikiDiscussions dev Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (5)Used By (0)

Monk ID PHP
===========

[](#monk-id-php)

[![Latest Stable Version](https://camo.githubusercontent.com/fd865c4307deeb49aebbc56312e1cc9b1f1a8687b59c13188904cfa93d98fd09/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6e6b6465762f6d6f6e6b2d69642e7376673f7374796c653d666c6174)](https://packagist.org/packages/monkdev/monk-id)[![Build Status](https://camo.githubusercontent.com/ca30a5c3a5bc0a65e109695ebe5cd502a6afc52669399ba982aa36935b18dd70/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4d6f6e6b4465762f6d6f6e6b2d69642d7068702f6465762e7376673f7374796c653d666c6174)](https://travis-ci.org/MonkDev/monk-id-php)[![codecov](https://camo.githubusercontent.com/bf023a5d6c70a3cd8d02d7bbaea70fec5889d72df45d634f5a0baa16ddde3821/68747470733a2f2f636f6465636f762e696f2f67682f4d6f6e6b4465762f6d6f6e6b2d69642d7068702f6272616e63682f6465762f67726170682f62616467652e737667)](https://codecov.io/gh/MonkDev/monk-id-php)[![Dependency Status](https://camo.githubusercontent.com/ced362968d65cd4d33712e0baef25e8122a356becbdfb7a825e876010ea0b2fd/68747470733a2f2f696d672e736869656c64732e696f2f67656d6e617369756d2f4d6f6e6b4465762f6d6f6e6b2d69642d7068702e7376673f7374796c653d666c6174)](https://gemnasium.com/MonkDev/monk-id-php)

Integrate Monk ID authentication and single sign-on for apps and websites on the server-side.

- [Documentation](http://monkdev.github.io/monk-id-php/classes/Monk.Id.html)

Overview
--------

[](#overview)

### Install

[](#install)

Using [Composer](http://getcomposer.org), add `monkdev/monk-id` to your `composer.json`:

```
{
  "require": {
    "monkdev/monk-id": "~1.0"
  }
}
```

```
$ composer update
```

Or:

```
$ composer require monkdev/monk-id:~1.0
```

### Configure

[](#configure)

Configuration is done in an external INI file. There's a sample file in this repository: `config/monkId.sample.yml`. Copy this file to your codebase, then load the config in your code during initialization:

```
Monk\Id::loadConfig('/path/to/monkId.ini', 'development');
```

Remember, replace the sample values with your own, and keep the file safe as it contains your app secret.

### Access

[](#access)

If you have Monk ID JS configured to store the payload automatically in a cookie (the default), you can skip the next part as the cookie is also loaded automatically.

If not, the encoded payload can be passed directly, which is useful if you're sending it in a GET/POST request instead:

```
Monk\Id::loadPayload($monkIdPayload);
```

Loading the payload must be done before trying to access any values stored in the payload. In an MVC framework, this usually means placing it in a method in your `ApplicationController` that's executed before the specific action is processed.

Once the payload is loaded, you can ask whether the user is logged in:

```
Monk\Id::loggedIn()
```

Or for their ID and email:

```
Monk\Id::userId()
Monk\Id::userEmail()
```

`null` is returned if the user isn't logged in or the payload can't be decoded and verified.

Development
-----------

[](#development)

[Composer](http://getcomposer.org) is used for dependency management and task running. Start by installing the dependencies:

```
$ composer install
```

### Tests

[](#tests)

Testing is done with [PHPUnit](http://phpunit.de). To run the tests:

```
$ composer test
```

Continuous integration is setup through [Travis CI](https://travis-ci.org/MonkDev/monk-id-php)to run the tests against PHP v5.6, v7.0, and v7.1. ([Circle CI](https://circleci.com/gh/MonkDev/monk-id-php)is also setup to run the tests against PHP v5.6, but is backup for now until multiple versions can easily be specified.) The code coverage results are sent to [Codecov](https://codecov.io/gh/MonkDev/monk-id-php) during CI for tracking over time. Badges for both are dispayed at the top of this README.

While the test suite is complete, it's not a bad idea to also test changes manually in real-world integrations.

### Documentation

[](#documentation)

[phpDocumentor](http://phpdoc.org) is used for code documentation. To build:

```
$ composer phpdoc
```

This creates a `doc` directory (that is ignored by git).

### Quality

[](#quality)

A number of code quality tools are configured to aid in development. To run them all at once:

```
$ composer quality
```

Each tool can also be run individually:

- [php -l](http://www.php.net/manual/en/function.php-check-syntax.php): `$ composer phplint`
- [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer): `$ composer phpcs`
- [PHP Copy/Paste Detector](https://github.com/sebastianbergmann/phpcpd): `$ composer phpcpd`
- [PHPLOC](https://github.com/sebastianbergmann/phploc): `$ composer phploc`
- [PHP Mess Detector](http://phpmd.org): `$ composer phpmd`
- [SensioLabs Security Checker](https://github.com/sensiolabs/security-checker): `$ composer security-checker`

Deployment
----------

[](#deployment)

Publishing a release to [Packagist](https://packagist.org) simply requires creating a git tag:

```
$ git tag -a vMAJOR.MINOR.PATCH -m "Version MAJOR.MINOR.PATCH"
$ git push origin vMAJOR.MINOR.PATCH
```

Be sure to choose the correct version by following [Semantic Versioning](http://semver.org).

### Publish Documentation

[](#publish-documentation)

After releasing a new version, the documentation must be manually built and published to the `gh-pages` branch.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 96.9% 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 ~542 days

Total

3

Last Release

3405d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/090c5b1fd0cb6c65565e01c7fdeea26f8d5aea018117a668caaa8011880b3d04?d=identicon)[skylerkatz](/maintainers/skylerkatz)

---

Top Contributors

[![jstayton](https://avatars.githubusercontent.com/u/98357?v=4)](https://github.com/jstayton "jstayton (126 commits)")[![etdebruin](https://avatars.githubusercontent.com/u/10570?v=4)](https://github.com/etdebruin "etdebruin (4 commits)")

---

Tags

loginmonksigninidlogoutsignupsignoutmonkdevmonkid

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/monkdev-monk-id/health.svg)

```
[![Health](https://phpackages.com/badges/monkdev-monk-id/health.svg)](https://phpackages.com/packages/monkdev-monk-id)
```

###  Alternatives

[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40820.2M67](/packages/auth0-auth0-php)[sarav/laravel-multiauth

A Simple Laravel Package for handling multiple authentication

5030.7k](/packages/sarav-laravel-multiauth)[sandstorm/usermanagement

Neos and Flow package for user management, login/logout, password reset and user activation

3828.4k](/packages/sandstorm-usermanagement)[mad-web/laravel-social-auth

Easy social auth integration with a lot of available providers

516.7k](/packages/mad-web-laravel-social-auth)[org_heigl/hybridauth

Lightweight Authentication Module for Zend-Framework 2 using the hybridauth-library

211.9k](/packages/org-heigl-hybridauth)

PHPackages © 2026

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