PHPackages                             notakey/simplesamlphp-module-oauth2 - 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. notakey/simplesamlphp-module-oauth2

ActiveSimplesamlphp-module

notakey/simplesamlphp-module-oauth2
===================================

A SimpleSAMLphp module adding support for the OAuth 2.0 protocol.

2.6.2(4y ago)0152MITPHPPHP &gt;=7.2.0

Since Apr 29Pushed 4y agoCompare

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

READMEChangelogDependencies (7)Versions (32)Used By (0)

SimpleSAMLphp OAuth2 module
===========================

[](#simplesamlphp-oauth2-module)

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

[](#installation)

This package add support for the OAuth2 protocol through a SimpleSAMLphp module installable through [Composer](https://getcomposer.org/). Installation can be as easy as executing:

```
composer.phar require sgomez/simplesamlphp-module-oauth2 1.0.0 # for SSP < 1.14
composer.phar require sgomez/simplesamlphp-module-oauth2 ~1.0 # for SSP >= 1.14
composer.phar require sgomez/simplesamlphp-module-oauth2 ~2.0 # for SSP >= 2.0|master

```

Configuration
-------------

[](#configuration)

### Configure the module

[](#configure-the-module)

Copy the template file to the config directory:

```
cp modules/oauth2/config-template/module_oauth2.php config/

```

and edit it. The options are self explained.

Create oauth2 clients
---------------------

[](#create-oauth2-clients)

To add and remove Oauth2 clients, you need to logon on simplesaml with an admin account. Open the *Federation* tab and you will see the *OAuth2 Client Registry* option.

You can specify as many redirect address as you want.

Using the module
----------------

[](#using-the-module)

This module is based on [Oauth2 Server from the PHP League](https://oauth2.thephpleague.com/) and supports implicit and explicit tokens.

### Create the oauth2 keys:

[](#create-the-oauth2-keys)

The oauth2 library used generates Json Web Tokens to create the Access Tokens, so you need to create a public and private cert keys:

To generate the private key run this command on the terminal:

```
openssl genrsa -out cert/oauth2_module.pem 1024

```

If you want to provide a passphrase for your private key run this command instead:

```
openssl genrsa -passout pass:_passphrase_ -out cert/oauth2_module.pem 1024

```

then extract the public key from the private key:

```
openssl rsa -in cert/oauth2_module.pem -pubout -out cert/oauth2_module.crt

```

or use your passphrase if provided on private key generation:

```
openssl rsa -in cert/oauth2_module.pem -passin pass:_passphrase_ -pubout -out cert/oauth2_module.crt

```

If you use a passphrase remember to configure it in the *module\_oauth2.php* config file.

### Explicit Token

[](#explicit-token)

To ask an explicit token see the [Authorization Code Grant](https://oauth2.thephpleague.com/authorization-server/auth-code-grant/)help page to know the parameters than you need to send (see Part One).

The address to the authorization server is: *{{baseurlpath}}/module.php/oauth2/authorize.php*

Now you need to ask for an access token. See the [Part Two](https://oauth2.thephpleague.com/authorization-server/auth-code-grant/).

The address to the access token server is: *{{baseurlpath}}/module.php/oauth2/access\_token.php*

### Implicit Token

[](#implicit-token)

To ask an implicit token see the [Implicit Grant](https://oauth2.thephpleague.com/authorization-server/implicit-grant/)help page to know the parameters than you need to send.

The address to the authorization server is: *{{baseurlpath}}/module.php/oauth2/authorize.php*

### Take the attributes

[](#take-the-attributes)

To recover the user attributes you need to send and `Authorization` header with the Access Token as a Bearer Token to the userinfo page: *{{baseurlpath}}/module.php/oauth2/userinfo.php*

Example:

```
curl --request GET \
  --url http://server.com/simplesaml/module.php/oauth2/userinfo.php \
  --header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni...'

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~89 days

Recently: every ~139 days

Total

28

Last Release

1627d ago

Major Versions

1.1.0 → 2.0.32017-04-04

1.1.1 → 2.0.42017-07-12

1.2.0 → 2.2.02017-09-15

1.2.1 → 2.2.12018-01-18

1.3.0 → 2.3.02018-10-17

PHP version history (2 changes)2.0.0-rc1PHP &gt;=5.5.9

2.5.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1211bd3d65e3ee8fcabe2cf8b499c2a94ab977b113a42e4ba1c1441d363d267d?d=identicon)[iasmanis](/maintainers/iasmanis)

---

Top Contributors

[![iasmanis](https://avatars.githubusercontent.com/u/28524181?v=4)](https://github.com/iasmanis "iasmanis (29 commits)")[![sgomez](https://avatars.githubusercontent.com/u/580701?v=4)](https://github.com/sgomez "sgomez (29 commits)")

---

Tags

oauth2

### Embed Badge

![Health badge](/badges/notakey-simplesamlphp-module-oauth2/health.svg)

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[simplesamlphp/simplesamlphp-module-oidc

A SimpleSAMLphp module adding support for the OpenID Connect protocol

5016.9k1](/packages/simplesamlphp-simplesamlphp-module-oidc)[league/oauth2-server-bundle

Symfony bundle .

2344.7M6](/packages/league-oauth2-server-bundle)[trikoder/oauth2-bundle

Symfony bundle which provides OAuth 2.0 authorization/resource server capabilities.

2521.8M](/packages/trikoder-oauth2-bundle)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

55342.3k2](/packages/jeremy379-laravel-openid-connect)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

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