Skip to content

Commit

Permalink
Add PHP library
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-hladky committed Apr 1, 2022
1 parent c866fc3 commit 62bd482
Show file tree
Hide file tree
Showing 74 changed files with 11,102 additions and 0 deletions.
5 changes: 5 additions & 0 deletions php/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode

/vendor/

.php-cs-fixer.cache
15 changes: 15 additions & 0 deletions php/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# BankID OpenId Connect Provider

A toolset to perform the authentication and authorization at BankId service. Supports OpenId Connect protocol.

## Features
- Simple: you only have to create the Provider, a core entity
- Extendable: you can adjust/extend the dependencies, if you wish
- PSR-compatible: feel free to pass you own PSR-compatible HTTP client (Guzzle one fits well) or PSR-compatible cache provider. Or don't, the library will work the either way.

## Documentation

See [documentation](documentation/README.md).

## Referenced libraries
- [`web-token/jwt-easy`](https://web-token.spomky-labs.com) (is used to validate the JWTs against exposed keys)
52 changes: 52 additions & 0 deletions php/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "fromjimmy/bankid-oidc-client",
"description": "OIDC client for BankId",
"autoload": {
"psr-4": {
"BankId\\OIDC\\": "src/"
}
},
"authors": [
{
"name": "Nikita Pavlovskiy",
"email": "[email protected]"
},
{
"name": "Jakub Drabik",
"email": "[email protected]"
}
],
"scripts": {
"phpstan": "phpstan analyse --configuration ./config/phpstan.neon",
"cs": "php-cs-fixer fix --config ./config/.php-cs-fixer.php -v",
"cs-check": "php-cs-fixer fix --config ./config/.php-cs-fixer.php --dry-run --stop-on-violation --format=txt -v",
"test": "phpunit test",
"check": [
"@cs-check",
"@phpstan",
"@test"
],
"start": "php -S localhost:3000 index.php",
"start:jwk": "php -S localhost:3001 index.php",
"start:ngrok": "ngrok http 3001"
},
"require-dev": {
"phpstan/phpstan": "^1.4",
"friendsofphp/php-cs-fixer": "^3.5",
"guzzlehttp/psr7": "^2.1",
"guzzlehttp/guzzle": "^7.4",
"phpunit/phpunit": "^9",
"ext-apcu": "*"
},
"require": {
"php": ">=8.1",
"ext-curl": "*",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"web-token/jwt-easy": "^2.2",
"web-token/jwt-signature-algorithm-rsa": "^2.2",
"web-token/jwt-signature-algorithm-hmac": "^2.2",
"web-token/jwt-key-mgmt": "^2.2",
"psr/simple-cache": "^3.0"
}
}
Loading

0 comments on commit 62bd482

Please sign in to comment.