PHPackages                             nodes/nemid - 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. nodes/nemid

AbandonedArchivedLibrary

nodes/nemid
===========

Nemid package for php

1.0.9(5y ago)286.3k19[4 issues](https://github.com/nodes-php/nodes-php-nemid/issues)MITPHP

Since Nov 8Pushed 5y ago3 watchersCompare

[ Source](https://github.com/nodes-php/nodes-php-nemid)[ Packagist](https://packagist.org/packages/nodes/nemid)[ Docs](http://nodesagency.com)[ RSS](/packages/nodes-nemid/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (1)Versions (17)Used By (0)

Nem-id integration
==================

[](#nem-id-integration)

A PHP Laravel library for using the Danish NemID for authenticating a user.

I'm sure it can be used easily without laravel also. Feel free to contribute to improvements

[![image](https://cloud.githubusercontent.com/assets/1279756/20196240/18e4a2b8-a79a-11e6-832b-36933da588e3.png)](https://cloud.githubusercontent.com/assets/1279756/20196240/18e4a2b8-a79a-11e6-832b-36933da588e3.png)

### The library supports:

[](#the-library-supports)

- Preparing the parameters for the applet
- Validate the returned signature and the certificate chain
- Extract Name and PID
- Matching PID to CPR SOAP webservice

This is a rewrite of an original library for an older version of the applet in java

Original library can be found:

**To become a nemid partner please follow this [Link](https://www.nets.eu/dk-da/l%C3%B8sninger/nemid/nemid-tjenesteudbyder/Pages/s%C3%A5dan-bliver-du-nemid-tjenesteudbyder.aspx)**

You must then modify your `composer.json` file and run `composer update` to include the latest version of the package in your project.

```
"require": {
    "nodes/nemid": "^1.0"
}
```

Or you can run the composer require command from your terminal.

```
composer require nodes/nemid:^1.0
```

🔧 Laravel Setup
---------------

[](#-laravel-setup)

Setup service provider in `config/app.php`

```
Nodes\Nemid\ServiceProvider::class
```

Publish config files

```
php artisan vendor:publish --provider="Nodes\NemId\ServiceProvider"
```

If you want to overwrite any existing config files use the `--force` parameter

```
php artisan vendor:publish --provider="Nodes\NemId\ServiceProvider" --force
```

Certificates
------------

[](#certificates)

#### Make sure you have bcmath installed

[](#make-sure-you-have-bcmath-installed)

```
sudo apt-get install php7.0-bcmath

```

If your p12 file is password protected and the password holds special characters, see [this stack overflow post](https://stackoverflow.com/questions/17404578/c-sharp-x509certificate2-unsupported-password-chars)

You got your p12 certificate now generate pem files, use following commands:

##### publicCertificate:

[](#publiccertificate)

`openssl pkcs12 -in path.p12 -out certificate.pem -clcerts -nokeys`

**NB: Remove the initial lines with `Bag Attributes` if present.**

Only the `-----BEGIN CERTIFICATE-----`, the base64 encoded certificate and `-----END CERTIFICATE-----` are relevant.

##### privateKey &amp; privateKeyPassword

[](#privatekey--privatekeypassword)

`openssl pkcs12 -in path.p12 -clcerts -out privateKey.pem`

Openssl will prompt you for a `PEM pass phrase` that will have to be set in your `nemid.php` configuration.

##### certifateAndPrivateKey &amp; password (For PID/CPR match)

[](#certifateandprivatekey--password-for-pidcpr-match)

`openssl pkcs12 -in path.p12 -out certificateAndPrivateKey.pem -chain`

The `-nodes` flag disables encryption and password protection of your certificates (it has nothing to do with Nodes).

If left out Openssl will prompt you for a `PEM pass phrase` that will have to be set in your `nemid.php` configuration.

Now you have all the certificates needed -

##### Copy the config file to htdocs and fill settings

[](#copy-the-config-file-to-htdocs-and-fill-settings)

Look in the config file for more help

\#Login integration In the inspiration folder an example of how you can setup the login flow can be found.

First prepare parameters to inject into the iframe. By creating a Login object.

`$login = new Login(config('nodes.nemid'));`

Setup a html document with the iframe url, js with param data and a form for callbacks

`$login->getIFrameUrl();`

`$login->getParams();`

The iframe will now submit the response to the form

The submitted data is base64 encoded, besides that all errors comes as string while successfully logins are xml documents

`$response = base64_decode(\Input::get('response'));`

`CertificationCheck::isXml($response)`

Now validate the certificates and extract name and PID from it by initialize a CertificationCheck object

`$userCertificate = new CertificationCheck(config('nodes.nemid'));`

`$certificate = $userCertificate->checkAndReturnCertificate($response);`

`$certificate->getSubject()->getName();`

`$certificate->getSubject()->getPid();`

PID/CPR match integration
-------------------------

[](#pidcpr-match-integration)

Initialize a PidCprMatch object and call the function with pid and cpr params.

`$pidCprMatch = new PidCprMatch(config('nodes.nemid'));`

`$response = $pidCprMatch->pidCprRequest($pid, $cpr);`

A response object will be returned. The object has functions to to check match and possible errors

`$response->didMatch();`

### Misc

[](#misc)

- The name `Pseudonym` or `Pseudonym Pseudonym` will be used for version 1 of nemid users, which have not set their name afterwards

Enjoy

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 66.3% 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 ~155 days

Recently: every ~243 days

Total

11

Last Release

1918d ago

Major Versions

0.1.0 → 1.0.02016-11-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/3aaee2c2b7632254faa8a589817712bdab2c7d46778fb26994eef75b20ec9c08?d=identicon)[nodes](/maintainers/nodes)

---

Top Contributors

[![Casperhr](https://avatars.githubusercontent.com/u/1279756?v=4)](https://github.com/Casperhr "Casperhr (53 commits)")[![zubfatal](https://avatars.githubusercontent.com/u/10694500?v=4)](https://github.com/zubfatal "zubfatal (9 commits)")[![rasmusebbesen](https://avatars.githubusercontent.com/u/944158?v=4)](https://github.com/rasmusebbesen "rasmusebbesen (8 commits)")[![JuanLeadSupply](https://avatars.githubusercontent.com/u/26138256?v=4)](https://github.com/JuanLeadSupply "JuanLeadSupply (7 commits)")[![lsv](https://avatars.githubusercontent.com/u/20708?v=4)](https://github.com/lsv "lsv (1 commits)")[![Kodzila](https://avatars.githubusercontent.com/u/28307744?v=4)](https://github.com/Kodzila "Kodzila (1 commits)")[![shumstra](https://avatars.githubusercontent.com/u/7113120?v=4)](https://github.com/shumstra "shumstra (1 commits)")

---

Tags

phplaravelnodesnemidnem-id

### Embed Badge

![Health badge](/badges/nodes-nemid/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

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