PHPackages                             progresivjose/piano-oauth - 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. progresivjose/piano-oauth

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

progresivjose/piano-oauth
=========================

v1.0.0(2y ago)012↓100%1MITPHPPHP ^8.1

Since Jul 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/progresivjose/piano-oauth)[ Packagist](https://packagist.org/packages/progresivjose/piano-oauth)[ RSS](/packages/progresivjose-piano-oauth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (1)

Introduction
============

[](#introduction)

The purpose of this package is to simplify the necessary steps to perform OAuth authentication for registered users in Piano.

Usage
-----

[](#usage)

First, you need to instantiate the PianoOauth class as follows.

```
use Progresivjose\PianoOauth;

$auth = new PianoOauth('AID', 'API_TOKEN', 'OAUTH_CLIENT_SECRET');
```

You can also specify the base url for the API Calls, by default the package use the sandbox URL **

```
use Progresivjose\PianoOauth;

//Example with the Base URL
$auth = new PianoOauth('AID', 'API_TOKEN', 'OAUTH_CLIENT_SECRET', 'http://api.tinypass.io');
```

Then you can call the preAuth method, where you pass two arguments:

- returnUrl: The URL where Piano should return with the authentication code.
- redirectUrl (optional): The URL where the package will redirect for authenticate the user.
- source (optional): If you need to specify the source of the page that is calling it will concatenate as a query param in the returnUrl.

This method will redirect the user to Piano Login Page.

```
$returnUrl = 'https://my-site.com/post-login';

$auth->preAuth($returnUrl);
```

And then, when the login form of piano redirects to your own page, you should capture the request query param called *code* and pass as an argument with the *returnUrl* to the postAuth method, this will return an User object with the data of the authenticated user, if it fails it should return null.

```
$code = $_REQUEST['code'];
$returnUrl = 'https://my-site.com/post-login';

$user = $this->postAuth($code, $returnUrl);
```

### User Object

[](#user-object)

This are the methods of the User Object:

- getName: Returns the name of the authenticated user.
- getLastname: Returns the lastname of the authenticated user.
- getPersonalName: Returns the personal name of the authenticated user.
- getEmail: Returns the email of the authenticated user.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1030d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fce62c1fc9685be28f3acecc31e627658104b91f43c8a314b910beaa4cc4dc5?d=identicon)[progresivjose](/maintainers/progresivjose)

---

Top Contributors

[![progresivjose](https://avatars.githubusercontent.com/u/178829?v=4)](https://github.com/progresivjose "progresivjose (7 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/progresivjose-piano-oauth/health.svg)

```
[![Health](https://phpackages.com/badges/progresivjose-piano-oauth/health.svg)](https://phpackages.com/packages/progresivjose-piano-oauth)
```

###  Alternatives

[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[rahul900day/laravel-captcha

Different types of Captcha implementation for Laravel Application.

10715.9k](/packages/rahul900day-laravel-captcha)[simplesamlphp/simplesamlphp-module-oidc

A SimpleSAMLphp module adding support for the OpenID Connect protocol

5016.9k1](/packages/simplesamlphp-simplesamlphp-module-oidc)[kinde-oss/kinde-auth-php

Kinde PHP SDK for authentication

2369.5k3](/packages/kinde-oss-kinde-auth-php)[descope/descope-php

Descope SDK for PHP

3814.0k](/packages/descope-descope-php)[njoguamos/laravel-turnstile

A laravel wrapper for https://developers.cloudflare.com/turnstile/

2315.9k2](/packages/njoguamos-laravel-turnstile)

PHPackages © 2026

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