Git Product home page Git Product logo

nemid's People

Contributors

casperhr avatar juanleadsupply avatar kodzila avatar lsv avatar rasmusebbesen avatar shumstra avatar zubfatal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nemid's Issues

Various questions

When generating certifikateAndPrivateKey I'm not prompted to input a password apart from the import password - am I missing something?

openssl pkcs12 -in path.p12 -out certicateAndPrivateKey.pem -nocerts -nodes

Does this package work with the javascript solution?

What do I input for serviceID? Is it the same as EntityID you make for the metadata file uploaded to https://administration.nemlog-in.dk?

Refactor the old core classes

All the old core classes from previous drupal plugin is very php 4. We already refactored the to objects from arrays. But there is still a lot..

Certificate chain not signed by any trustedroots

Fatal error: Uncaught Nodes\NemId\Login\CertificationCheck\Exceptions\InvalidCertificateException: Certificate chain not signed by any trustedroots in /var/www/html/test/nemid/src/Login/CertificationCheck/CertificationCheck.php:212 Stack trace: #0 /var/www/html/test/nemid/src/Login/CertificationCheck/CertificationCheck.php(100): Nodes\NemId\Login\CertificationCheck\CertificationCheck->simpleVerifyCertificateChain(Array) #1 /var/www/html/test/nemid/validateCPR.php(21): Nodes\NemId\Login\CertificationCheck\CertificationCheck->checkAndReturnCertificate('<?xml version="...') #2 {main} thrown in /var/www/html/test/nemid/src/Login/CertificationCheck/CertificationCheck.php on line 212

In browser I have logged with test user and got base64 response
using that response I am trying to call pidCprRequest()
Please let me know if anything missing

Here is my code.
$response = base64_decode($base64Response);
require DIR.'/vendor/autoload.php';
ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
$response = "base 64 response after login using nemid and password";
$check = CertificationCheck::isXml($response);

$config = include DIR.'/config/nemid.php';

$config['test'] = true;
$config['login']['testSettings']['privateKeyPassword'] = 'Test1234';
$config['login']['testSettings']['privateKeyLocation'] = DIR.'/testcertificates/test_private.pem';
$config['login']['testSettings']['certificateLocation'] = DIR.'/testcertificates/test_public.pem';
$userCertificate = new CertificationCheck($config);

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

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

$pid = $certificate->getSubject()->getPid();

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

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

$isCPRValid = $response->didMatch();
print_r($isCPRValid);

Signature could not be validated !!!

I had this error too and found this: https://digitaliser.dk/forum/2976395

The problem I had and looking at your code, seems you still have is:

The signed data should of the base64 bit hash of the normalizes string. (Not the normalized string itself).
Also (I'm in C#) I have to do rsa.SignHash (not rsa.SignData).

Hope this help, if you still having problems.

A little help getting started

Hi
I want to use your library in a php project. I have created the .pem certificates with openssl.exe on a windows 10 machine but this line:
openssl_pkey_get_private($this->settings->getPrivateKey(), $this->settings->getPrivateKeyPassword());

in Login.php gives me no output. I have checked that $this->settings->getPrivateKey() contains the certificate string and $this->settings->getPrivateKeyPassword() contains my password. Has this something to do with PHP version on the server ??

checkOscp gives cURL error

Using a test certificate and a test user, when checkOscp is enabled i get the following error:
Failed to check certificate: cURL error 56: Recv failure: Connection reset by peer (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

I have not tried this against the production environment, so I'm not sure if it's related to using the test environment.

Did a bit of debugging, and it seems it tries to send the request to: http://ocsp.systemtest34.trust2408.com/responder if that helps.

PSR-4 Update

Hi

The package needs to be updated with PSR-4 compliance, Composer 1.x warns about the issue, and Composer 2.0 was already released. I can update the package, but it should be a new major release. I already have a fork with some issues fixed. Are you interested in a pull request or you consider the package abandoned? Thanks!

Deprecation Notice: Class Nodes\NemId\PidCprMatch\Settings located in ./vendor/nodes/nemid/src/Webservice/Settings.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nodes\NemId\PidCprMatch\Responses\Response located in ./vendor/nodes/nemid/src/Webservice/PidCprMatch/Responses/Response.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Nodes\NemId\PidCprMatch\PidCprMatch located in ./vendor/nodes/nemid/src/Webservice/PidCprMatch/PidCprMatch.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201

Help Wanted: Issue with the integration

When trying to get the iFrame to work, i keep getting a consistent APP001 error from the iFrame. I've verified that my parameters are fine through the developer site, and tried additional ways of including the parameters, to make sure i didn't malform them somewhere along the way.

Is the Origin a necessity when using the iFrame, or do you know if it's a possible error with running it in a localhost environment?

Rid to CPR match

It would be great if anyone has any info on how to do the same with a Rid (subjectSerialNumber) instead of Pid?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.