diff --git a/README.md b/README.md index fedb444..d51baa2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # chillerlan/php-oauth -A transparent, framework-agnostic, easily extensible PHP [PSR-18](https://www.php-fig.org/psr/psr-18/) OAuth 1/2 client with a user-friendly API, fully [PSR-7](https://www.php-fig.org/psr/psr-7/)/[PSR-17](https://www.php-fig.org/psr/psr-17/) compatible. +A transparent, framework-agnostic, easily extensible PHP [PSR-18](https://www.php-fig.org/psr/psr-18/) OAuth client with a user-friendly API, fully [PSR-7](https://www.php-fig.org/psr/psr-7/)/[PSR-17](https://www.php-fig.org/psr/psr-17/) compatible. [![PHP Version Support][php-badge]][php] @@ -35,20 +35,20 @@ A transparent, framework-agnostic, easily extensible PHP [PSR-18](https://www.ph ## Features - OAuth client capabilities - - [OAuth 1.0a](https://oauth.net/core/1.0a/) - - [OAuth 2.0](https://oauth.net/2/) - - [Authorization Code Grant](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1) - - [Client Credentials Grant](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4) - - [Token refresh](https://datatracker.ietf.org/doc/html/rfc6749#section-1.5) - - [CSRF Token](https://datatracker.ietf.org/doc/html/rfc6749#section-10.12) ("state" parameter) - - [RFC-7009: Token Revocation](https://datatracker.ietf.org/doc/html/rfc7009) - - [RFC-7636: PKCE](https://datatracker.ietf.org/doc/html/rfc7636) (Proof Key for Code Exchange) - - [RFC-9126: PAR](https://datatracker.ietf.org/doc/html/rfc9126) (Pushed Authorization Requests) - - Proprietary, OAuth-like authorization flows (e.g. [Last.fm](https://www.last.fm/api/authentication)) - - Invalidation of access tokens (if supported by the provider) + - [OAuth 1.0a](https://oauth.net/core/1.0a/) ([RFC-5849](https://datatracker.ietf.org/doc/html/rfc5849)) + - [OAuth 2.0](https://oauth.net/2/) ([RFC-6749](https://datatracker.ietf.org/doc/html/rfc6749)) + - [Authorization Code Grant](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1) + - [Client Credentials Grant](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4) + - [Token refresh](https://datatracker.ietf.org/doc/html/rfc6749#section-1.5) + - [CSRF Token](https://datatracker.ietf.org/doc/html/rfc6749#section-10.12) ("state" parameter) + - [RFC-7009: Token Revocation](https://datatracker.ietf.org/doc/html/rfc7009) + - [RFC-7636: PKCE](https://datatracker.ietf.org/doc/html/rfc7636) (Proof Key for Code Exchange) + - [RFC-9126: PAR](https://datatracker.ietf.org/doc/html/rfc9126) (Pushed Authorization Requests) + - Proprietary, OAuth-like authorization flows (e.g. [Last.fm](https://www.last.fm/api/authentication)) + - Invalidation of access tokens (if supported by the provider) - Several built-in provider implementations ([see below](#implemented-providers)) - - Provider instances act as [PSR-18](https://www.php-fig.org/psr/psr-18/) HTTP client, wrapping the given PSR-18 HTTP instance - - Requests to the provider API will have required OAuth headers and tokens added automatically + - Provider instances act as [PSR-18](https://www.php-fig.org/psr/psr-18/) HTTP client, wrapping the given PSR-18 HTTP instance + - Requests to the provider API will have required OAuth headers and tokens added automatically - Optional token encryption via [`sodium_crypto_secretbox()`](https://www.php.net/manual/en/function.sodium-crypto-secretbox) for the internal storage engines - A unified user data object `AuthenticatedUser` via the `OAuthInterface::me()` method @@ -57,7 +57,7 @@ A transparent, framework-agnostic, easily extensible PHP [PSR-18](https://www.ph - PHP 8.1+ - extensions: `json`, `sodium` - - from dependencies: `curl`, `fileinfo`, `intl`, `mbstring`, `simplexml`, `zlib` + - from dependencies: `curl`, `fileinfo`, `intl`, `mbstring`, `simplexml`, `zlib` - a [PSR-18](https://www.php-fig.org/psr/psr-18/) compatible HTTP client library of your choice - [PSR-17](https://www.php-fig.org/psr/psr-17/) compatible `RequestFactory`, `StreamFactory` and `UriFactory` diff --git a/docs/Basics/Configuration-settings.md b/docs/Basics/Configuration-settings.md index 6dc3854..2f9b81c 100644 --- a/docs/Basics/Configuration-settings.md +++ b/docs/Basics/Configuration-settings.md @@ -1,5 +1,5 @@ # Configuration settings - + ## key The application key (or client-id) given by your provider diff --git a/docs/Basics/Overview.md b/docs/Basics/Overview.md index fbabb0b..99262a7 100644 --- a/docs/Basics/Overview.md +++ b/docs/Basics/Overview.md @@ -7,8 +7,8 @@ fully [PSR-7](https://www.php-fig.org/psr/psr-7/)/[PSR-17](https://www.php-fig.o ## Features - OAuth client capabilities - - [OAuth 1.0a](https://oauth.net/core/1.0a/) - - [OAuth 2.0](https://oauth.net/2/) + - [OAuth 1.0a](https://oauth.net/core/1.0a/) ([RFC-5849](https://datatracker.ietf.org/doc/html/rfc5849)) + - [OAuth 2.0](https://oauth.net/2/) ([RFC-6749](https://datatracker.ietf.org/doc/html/rfc6749)) - [Authorization Code Grant](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1) - [Client Credentials Grant](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4) - [Token refresh](https://datatracker.ietf.org/doc/html/rfc6749#section-1.5) diff --git a/docs/Development/Create-tests.md b/docs/Development/Create-tests.md index 9608899..2a434e8 100644 --- a/docs/Development/Create-tests.md +++ b/docs/Development/Create-tests.md @@ -86,7 +86,7 @@ The JSON looks similar to the following: "accessTokenSecret": null, "accessToken": "", "refreshToken": null, - "expires": -9002, + "expires": -51966, "extraParams": { "token_type": "bearer" }, diff --git a/docs/oauth-options-doc.php b/docs/oauth-options-doc.php index 73e30d6..c73eb3c 100644 --- a/docs/oauth-options-doc.php +++ b/docs/oauth-options-doc.php @@ -8,17 +8,17 @@ * @license MIT */ -use chillerlan\OAuth\OAuthOptionsTrait; +use chillerlan\OAuth\OAuthOptions; require_once __DIR__.'/../vendor/autoload.php'; $file = 'Basics/Configuration-settings.md'; $content = [ '# Configuration settings', - '', + '', ]; -$reflectionClass = new ReflectionClass(OAuthOptionsTrait::class); +$reflectionClass = new ReflectionClass(OAuthOptions::class); foreach($reflectionClass->getProperties(ReflectionProperty::IS_PROTECTED) as $reflectionProperty){ $docblock = $reflectionProperty->getDocComment(); @@ -51,14 +51,14 @@ // collect links for "see also" if(str_starts_with($line, '@see')){ - $see[] = $line; + $see[] = substr($line, 5); // cut off the "@see " continue; } // collect links for "links" if(str_starts_with($line, '@link')){ - $link[] = $line; + $link[] = substr($line, 6); // cut off the "@link " continue; } @@ -71,7 +71,6 @@ $content[] = "\n**See also:**\n"; foreach($see as $line){ - $line = substr($line, 5); // cut off the "@see " // normal links if(str_starts_with($line, 'http')){ @@ -100,7 +99,6 @@ $content[] = "\n**Links:**\n"; foreach($link as $line){ - $line = substr($line, 6); // cut off the "@link " // skip non-url if(!str_starts_with($line, 'http')){ @@ -123,6 +121,6 @@ file_put_contents(__DIR__.'/'.$file, implode("\n", $content)); -printf('Built "%s" from "%s"', $file, OAuthOptionsTrait::class); +printf('Built "%s" from "%s"', $file, OAuthOptions::class); exit(0);