Download the PHP package ekapusta/oauth2-esia without Composer
On this page you can find all versions of the php package ekapusta/oauth2-esia. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ekapusta/oauth2-esia
More information about ekapusta/oauth2-esia
Files in ekapusta/oauth2-esia
Package oauth2-esia
Short Description Allows to authenticate in ESIA and get authenticated individual personal information.
License MIT
Informations about the package oauth2-esia
ESIA Provider for OAuth 2.0 Client
Allows to authenticate in ESIA and get authenticated individual personal information.
Implemented as adapter to the PHP League's OAuth 2.0 Client.
Installing
To install, use composer:
composer require ekapusta/oauth2-esia
Usage
Usage is the same as the normal client, using Ekapusta\OAuth2Esia\Provider\EsiaProvider
as the provider:
Configure provider
Which signer to use?
- If you use RSA keys, then
OpensslPkcs7
is enough. - If you use GOST keys and compiled PHP with GOST ciphers, then
OpensslPkcs7
is enough. - If you use GOST keys and have openssl-compatible tool, then use
OpensslCli
. It hastoolpath
param. - If you use GOST keys and you are docker-addict, then you can use
'toolpath' => 'docker run --rm -i -v $(pwd):$(pwd) -w $(pwd) rnix/openssl-gost openssl'
.
Which remote signer to use?
- If your system electronic signature algorythm is default RS256, then do nothing. Under the hood it uses Sha256 remote signer.
- If you use GOST3410_2012_256 signature, then use
OpenSslCliJwtSigner
, passing to it path toopenssl
tool. For dockers pass to it something likedocker run --rm -i -v $(pwd):$(pwd) -v /tmp/tmp -w $(pwd) rnix/openssl-gost openssl'
./tmp
volume is important there!
Auth flow
Auth flow is standard.
Simplified facade
If you don't like classes with about 20 public methods, there is simplified facade-class.
Example $esiaPersonData
Testing
Node is used for interactive headless chrome auth bot.
About ESIA
There are three ESIA user identification levels:
- simple
- standard
- confrimed
Information system can ask info about user from individuals register.
ESIA user could be:
- individual
- individual entrepreneur (individual + flag "is entrepreneur")
- individual connected to legal entities accounts
- individual connected to public authorities accounts
Users after individual can be only of confirmed identification level.
User info
After user's permission his/her info can be read through REST.
Scopes
To get some info about user system should ask it through "scope" param. Same param entered in paper-written application for connection to ESIA.
Scope is analog of permissions in mobile apps, but for user's data.
Here are list of possible scopes: fullname, birthdate, gender, snils, inn, id_doc, birthplace, medical_doc, military_doc, foreign_passport_doc, drivers_licence_doc, vehicles, email, mobile, contacts, kid_fullname.
Security algos
ESIA REST supports both RSA2048+SHA256 and GOST3410-2001+GOST341194 algos.
Authentication methods
There are two ways to authenticate user: SAML 2.0 and OpenID Connect 1.0 (OAuth 2.0 extension). SAML 2.0 is only for public authorities.
For legal entities OpenID Connect is used.
Terms
ESIA from Russian "ЕСИА", which is "Единая система идентификации и аутентификации". Translated as "Unified identification and authentication system".
Links
All versions of oauth2-esia with dependencies
lcobucci/jwt Version ^3.2.2
league/oauth2-client Version ^2.4.1
psr/log Version ^1.0
ramsey/uuid Version ^3.0 || ^4.0