dvsa/php-govuk-account

GOV.UK Account 的 league/oauth2-client 提供商

2.0.1 2024-05-16 08:52 UTC

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_keyexpected_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

贡献

请参阅我们的 贡献指南贡献者行为准则