dvsa / php-govuk-account
GOV.UK Account 的 league/oauth2-client 提供商
2.0.1
2024-05-16 08:52 UTC
Requires
- php: ^8.2
- ext-json: *
- firebase/php-jwt: ^6.3
- guzzlehttp/guzzle: ^7.5
- guzzlehttp/psr7: ^2.4.5
- illuminate/collections: ^8.0
- league/oauth2-client: ^2.6
- paragonie/random_compat: ^9.99
- psr/cache: ^1.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/log: ^1.1
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
- mockery/mockery: ^1.5
- phpunit/phpunit: ^9.5.4
This package is auto-updated.
Last update: 2024-09-15 15:53:23 UTC
README
一个提供者(基于 PHP League OAuth2-Client),用于与 GOV.UK Account 交互。
支持使用发现端点自动配置大多数设置。
对于身份验证(当验证 JWT 时,您需要定义
identity_assurance_public_key
和expected_core_identity_issuer
,直到密钥和发行者在发现端点上发布,暂时使用短期的定义。)
安装
推荐的安装方式是通过 Composer。
composer require dvsa/php-govuk-account
配置
您可以参考 PHP League OAuth2-Client 提供的文档,因为此包是该抽象包的提供者。
实例化提供者时,构造函数接受在 array $options = []
中定义的 附加 属性,这些属性特定于此提供者;除了 AbstractProvider(PHP League OAuth2-Client)提供的默认选项外。
'discovery_endpoint' => 'https://oidc.integration.account.gov.uk/.well-known/openid-configuration', // Endpoint for OIDC discovery 'client_id' => '', // Client ID issued by GOV.UK Account 'keys' => [ 'algorithm' => '', // Algorithm for private_key 'private_key' => '', // Private key used to encode assertion when obtaining access token (public key must be shared with GOV.UK Account) 'identity_assurance_public_key' => [], // THe public key used to verify the JWTCoreIdentity token from UserDetails endpoint (if initial flow included identity assurance) ], 'redirect_uri' => [ 'logged_in' => '', // The url used for redirection back to the service ], 'expected_core_identity_issuer' => 'identity.integration.account.gov.uk', // Issuer for JWTCoreIdentity token