https://github.com/e-identification/bankid-php
BankID SDK
https://github.com/e-identification/bankid-php
asynchronous bank-id bankid client php php71 reactive-programming sdk
Last synced: 10 months ago
JSON representation
BankID SDK
- Host: GitHub
- URL: https://github.com/e-identification/bankid-php
- Owner: e-identification
- License: mit
- Created: 2018-10-13T07:42:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-21T19:29:27.000Z (over 7 years ago)
- Last Synced: 2025-04-09T20:04:32.651Z (about 1 year ago)
- Topics: asynchronous, bank-id, bankid, client, php, php71, reactive-programming, sdk
- Language: PHP
- Homepage:
- Size: 66.4 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BankID SDK library
A SDK for providing BankID services as a RP (Relying party).
Supports the latest v5 features.
[][link-packagist]
[](https://packagist.org/packages/nicklasw/bankid-sdk)
[](https://packagist.org/packages/nicklasw/bankid-sdk)
[](https://travis-ci.org/NicklasWallgren/bankid-sdk)
[](https://packagist.org/packages/nicklasw/bankid-sdk)
# Installation
The library can be installed through `composer`
```bash
composer require nicklasw/bankid-sdk
```
# Features
- Supports all v5 features
- Supports asynchronous and parallel requests
# Examples
## Initiate authenticate request
```php
$client = new Client(new Config());
$authenticationResponse = $client->authenticate(new AuthenticationPayload(, ));
if (!$authenticationResponse->isSuccess()) {
var_dump($authenticationResponse->getErrorCode(), $authenticationResponse->getDetails());
return;
}
$collectResponse = $authenticationResponse->collect();
```
## Execute parallel requests
```php
$client = new ClientAsynchronous(new Config());
$promises[] = $client->authenticate(new AuthenticationPayload(, ));
$promises[] = $client->authenticate(new AuthenticationPayload(, ));
// Parallel requests, authenticate users
foreach (unwrap($promises) as $result) {
/**
* @var AuthenticationResponse $result
*/
var_dump($result->isSuccess());
}
```
# Certificates
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.
## Generate PEM certificate
```bash
openssl pkcs12 -in .pfx -out .pem -nodes
```
## Docker
```bash
make && make bash
```
## Unit tests
```bash
composer run test
```
## Contributing
- 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
## Contributors
- [Nicklas Wallgren](https://github.com/NicklasWallgren)
- [All Contributors][link-contributors]
[ico-downloads]: https://img.shields.io/packagist/dt/nicklasw/bankid-sdk.svg?style=flat-square
[link-packagist]: https://packagist.org/packages/nicklasw/bankid-sdk
[link-contributors]: ../../contributors