dvsa/php-govuk-account

A league/oauth2-client provider for GOV.UK One Login
15,127
Install
composer require dvsa/php-govuk-account
Latest Version:v4.0.0
PHP:~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
Laravel:8 – 12
License:MIT
Last Updated:Jun 2, 2026
Links: GitHub  ·  Packagist
Maintainer: dvsa

GOV.UK One Login (OAuth2 Provider)

A provider (based on PHP League OAuth2-Client) to interact with GOV.UK Account.

Supports autoconfiguration for most settings using the discovery endpoint.

For identity assurance (when verifying the JWT in , you will need to define the identity_assurance_public_key and expected_core_identity_issuer for the short interim until the key and issuer is published on the discovery endpoint.

Installing

The recommended way to install is through Composer.

composer require dvsa/php-govuk-account

Configuring

You may want to refer to the documentation provided at PHP League OAuth2-Client as this package is a provider for that abstract package.

When instantiating the provider, the constructor accepts additional attributes defined in array $options = [] which are specific for this provider; in addition to the default options provided by the AbstractProvider (PHP League OAuth2-Client).

'base_uri' => 'https://oidc.integration.account.gov.uk', // Base URI for the GOV.UK One Login API 
'discovery_endpoint' => 'https://oidc.integration.account.gov.uk/.well-known/openid-configuration', // Endpoint for OIDC discovery
'core_identity_did_document_url' => 'https://identity.integration.account.gov.uk/.well-known/did.json', // The DID document URL used to verify the JWTCoreIdentity token from UserDetails endpoint
'client_id' => '', // Client ID issued by GOV.UK One Login
'keys' => [
    'algorithm' => 'RS256', // Algorithm for private_key
    'private_key' => '', // Private key used to encode assertion when obtaining access token (public key must be shared with GOV.UK One Login)
    'public_key' => '', // Public key used to decode assertion when obtaining access token
],
'redirect_uri' => [
    'logged_in' => '', // The url used for redirection back to the service
    'logged_out' => '', // The url used for redirection back to the service
],
'expected_core_identity_issuer' => 'https://identity.integration.account.gov.uk/', // Issuer for JWTCoreIdentity token

Contributing

Please refer to our Contribution Guide and Contributor Code of Conduct.

Related Packages

aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PH...

41,736,217 1,714
overtrue/laravel-wechat

微信 SDK for Laravel

1,894,223 2,900
aacotroneo/laravel-saml2

A Laravel package for Saml2 integration as a SP (service provider) for multiple...

4,942,308 568
zgldh/qiniu-laravel-storage

Qiniu Resource (Cloud) Storage SDK for Laravel 5/6/7/8/9

408,913 516
pitbulk/laravel4-saml2

A Laravel 4.2 package for Saml2 integration as a SP (service provider) based on...

1,480 2

Version History

Version Released PHP Laravel License
v4.0.0 ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 MIT
3.1.0 ^8.2 ^8.0 MIT
3.0.0 ^8.2 ^8.0 MIT
2.0.1 ^8.2 ^8.0 MIT
2.0.0 ^8.2 ^8.0 MIT