mathieu-dumoutier / oauth2-orcid
ORCID OAuth 2.0 Client Provider for The PHP League OAuth2-Client
Installs: 6 362
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=8.0
- league/oauth2-client: ^2.0
Requires (Dev)
- phpunit/phpunit: 8.* || 9.*
This package is not auto-updated.
Last update: 2024-11-12 22:42:52 UTC
README
This package provides ORCID OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
Installation
To install, use composer:
composer require mathieu-dumoutier/oauth2-orcid
Usage
Usage is the same as The League's OAuth client, using \MathieuDumoutier\OAuth2\Client\Provider\Orcid
as the provider.
knpuniversity/oauth2-client-bundle configuration example
knpu_oauth2_client: clients: orcid_oauth: type: generic provider_class: MathieuDumoutier\OAuth2\Client\Provider\Orcid provider_options: "scopes": '%env(ORCID_OAUTH_SCOPES)%' "use_member_api": '%env(ORCID_OAUTH_SANDBOX_MODE)%' "sandbox_mode": '%env(ORCID_OAUTH_MEMBER_API)%' "api_version": '%env(ORCID_OAUTH_API_VERSION)%' client_id: '%env(ORCID_APP_ID)%' client_secret: '%env(ORCID_APP_SECRET)%' redirect_route: orcid_check redirect_params: {} use_state: false
You must define the 6 environment variables :
- ORCID_APP_ID
- ORCID_APP_SECRET
- ORCID_OAUTH_SCOPES (see https://info.orcid.org/documentation/integration-guide/getting-started-with-your-orcid-integration/#easy-faq-2569)
- ORCID_OAUTH_SANDBOX_MODE (0 or 1)
- ORCID_OAUTH_MEMBER_API (0 or 1)
- ORCID_OAUTH_API_VERSION (v2.0, v2.1 or v3.0)
You must create the route "orcid_check".
Testing
$ ./vendor/bin/phpunit