PHPackages                             net-passport/net-passport - 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. net-passport/net-passport

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

net-passport/net-passport
=========================

The single line sign on library for youuuu :)

1.1(5y ago)0200proprietaryPHP

Since May 10Pushed 5y ago2 watchersCompare

[ Source](https://github.com/orenz/urban-fiesta)[ Packagist](https://packagist.org/packages/net-passport/net-passport)[ RSS](/packages/net-passport-net-passport/feed)WikiDiscussions main Synced 3w ago

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

Net Passport
============

[](#net-passport)

net-passport is a all-strategy (Google, Facebook, etc...) server side authentication using Pure PHP in just a single line of code. You don't need any more boilerplate, repetitive configurations, strategies installations and more. Just use net-passport in your web application and manage your authenticated users! In addition, net-passport gives you a simple way for sign and verify messages using your NetPassport ID.

prerequisites
-------------

[](#prerequisites)

If you don't have one then go to [NetPassport](netpassport.io/signup) and create an account. After that, navigate to Console (on the left):

[![alt text](https://camo.githubusercontent.com/da67d68175631b482d5810cc9fa8a0d9eeedc6f3d15026dee89065e697d1a466/68747470733a2f2f6e657470617373706f72742e696f2f7075626c69632f636f6e736f6c652e504e47 "NetPassport Console")](https://camo.githubusercontent.com/da67d68175631b482d5810cc9fa8a0d9eeedc6f3d15026dee89065e697d1a466/68747470733a2f2f6e657470617373706f72742e696f2f7075626c69632f636f6e736f6c652e504e47)

Then, click on "Generate key pair", scroll down and download the key-pair.

Alternatively, you could upload a private key you generated by yourself.

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

[](#installation)

```
$ composer require net-passport/net-passport
```

Usage
-----

[](#usage)

```
use NetPassport\Signer;
```

Get your netPassportID in [NetPassportHome](netpassport.io/home) on the top right:

[![alt text](https://camo.githubusercontent.com/4875379ed5050e9889dfe8f6ac030212fa08d7a470e607ebf39e60006ed5e90e/68747470733a2f2f6e657470617373706f72742e696f2f7075626c69632f69642e504e47 "NetPassport id")](https://camo.githubusercontent.com/4875379ed5050e9889dfe8f6ac030212fa08d7a470e607ebf39e60006ed5e90e/68747470733a2f2f6e657470617373706f72742e696f2f7075626c69632f69642e504e47)

you could click the "Copy" button to copy the id and paste it inside your code.

### Load you private key

[](#load-you-private-key)

\####load from disk

```
use Lcobucci\JWT\Signer\Key\LocalFileReference;
$privateKey = LocalFileReference::file(__DIR__ . '/path-to-my-key-stored-in-a-file.pem');
```

\####Or load the keys from memory

```
 use Lcobucci\JWT\Signer\Key\InMemory;
$privateKey = InMemory::plainText('my-key-as-plaintext');
```

Server to server authentication
-------------------------------

[](#server-to-server-authentication)

#### Sign data

[](#sign-data)

```
// Initiate your message object
$message = [
  'netPassportID'   => "112233",
  'myData'          => "Hi there",
];

// Pass in two parameters that includes your object message (as mentioned above) and a private key or path to your private key
$signature = Signer::signObject($message, $privateKey);
```

#### Verify data

[](#verify-data)

```
// Pass in two parameters that includes your original object message and the hashed signature of the message
$verifiedMessage = Signer::verify($message, $privateKey);
```

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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

Every ~9 days

Total

2

Last Release

1869d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6067331?v=4)[tht7](/maintainers/tht7)[@tht7](https://github.com/tht7)

---

Top Contributors

[![tht7](https://avatars.githubusercontent.com/u/6067331?v=4)](https://github.com/tht7 "tht7 (2 commits)")

### Embed Badge

![Health badge](/badges/net-passport-net-passport/health.svg)

```
[![Health](https://phpackages.com/badges/net-passport-net-passport/health.svg)](https://phpackages.com/packages/net-passport-net-passport)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.7k51.8M369](/packages/tymon-jwt-auth)[league/oauth2-server

A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.

6.7k147.0M288](/packages/league-oauth2-server)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

84611.1M63](/packages/php-open-source-saver-jwt-auth)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

585684.2k1](/packages/scheb-2fa)[jeremy379/laravel-openid-connect

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

59437.0k8](/packages/jeremy379-laravel-openid-connect)[scheb/2fa-trusted-device

Extends scheb/2fa-bundle with trusted devices support

365.8M33](/packages/scheb-2fa-trusted-device)

PHPackages © 2026

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