A SDK for providing BankID services as a RP (Relying party). Supports the latest v5 features.
The library can be installed through composer
composer require nicklasw/bankid-sdk
- Supports all v5 features
- Supports asynchronous and parallel requests
$client = new Client(new Config(<CERTFICATE>));
$authenticationResponse = $client->authenticate(new AuthenticationPayload(<PERSONAL NUMBER>, <IP ADDRESS>));
if (!$authenticationResponse->isSuccess()) {
var_dump($authenticationResponse->getErrorCode(), $authenticationResponse->getDetails());
return;
}
$collectResponse = $authenticationResponse->collect();
$client = new ClientAsynchronous(new Config(<CERTFICATE>));
$promises[] = $client->authenticate(new AuthenticationPayload(<PERSONAL NUMBER>, <IP ADDRESS>));
$promises[] = $client->authenticate(new AuthenticationPayload(<PERSONAL NUMBER>, <IP ADDRESS>));
// Parallel requests, authenticate users
foreach (unwrap($promises) as $result) {
/**
* @var AuthenticationResponse $result
*/
var_dump($result->isSuccess());
}
The web service API can only be accessed by a RP that has a valid SSL client certificate. The RP certificate is obtained from the bank that the RP has purchased the BankID service from.
openssl pkcs12 -in <filename>.pfx -out <cert>.pem -nodes
make && make bash
composer run test
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Useful information about your new features'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request