Skip to content

Commit 989f0e8

Browse files
committed
:octocat: Google PKCE and TokenInvalidate support
1 parent e92b326 commit 989f0e8

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Note: check the [releases](https://github.com/chillerlan/php-oauth/releases) for
120120
| [Gitea](https://docs.gitea.com/api/1.20/) | [link](https://gitea.com/user/settings/applications) | [link](https://gitea.com/user/settings/applications) | 2 |||| || |
121121
| [GitHub](https://docs.github.com/rest) | [link](https://github.com/settings/developers) | [link](https://github.com/settings/applications) | 2 ||| | || |
122122
| [GitLab](https://docs.gitlab.com/ee/api/rest/) | [link](https://gitlab.com/profile/applications) | | 2 ||| ||| |
123-
| [Google](https://developers.google.com/oauthplayground/) | [link](https://console.developers.google.com/apis/credentials) | [link](https://myaccount.google.com/connections) | 2 ||| | | | |
123+
| [Google](https://developers.google.com/oauthplayground/) | [link](https://console.developers.google.com/apis/credentials) | [link](https://myaccount.google.com/connections) | 2 ||| | | | |
124124
| [GuildWars2](https://wiki.guildwars2.com/wiki/API:Main) | [link](https://account.arena.net/applications) | [link](https://account.arena.net/applications) | 2 || | | | | |
125125
| [Imgur](https://apidocs.imgur.com) | [link](https://api.imgur.com/oauth2/addclient) | [link](https://imgur.com/account/settings/apps) | 2 ||| | || |
126126
| [LastFM](https://www.last.fm/api/) | [link](https://www.last.fm/api/account/create) | [link](https://www.last.fm/settings/applications) | - || | | | | |
@@ -150,7 +150,7 @@ Note: check the [releases](https://github.com/chillerlan/php-oauth/releases) for
150150
| [TwitterCC](https://developer.twitter.com/en/docs/basics/authentication/overview/application-only) | [link](https://developer.twitter.com/apps) | [link](https://twitter.com/settings/applications) | 2 | | | || | |
151151
| [Vimeo](https://developer.vimeo.com) | [link](https://developer.vimeo.com/apps) | [link](https://vimeo.com/settings/apps) | 2 ||| || ||
152152
| [WordPress](https://developer.wordpress.com/docs/api/) | [link](https://developer.wordpress.com/apps/) | [link](https://wordpress.com/me/security/connected-applications) | 2 ||| | | | |
153-
| [YouTube](https://developers.google.com/oauthplayground/) | [link](https://console.developers.google.com/apis/credentials) | [link](https://myaccount.google.com/connections) | 2 ||| | | | |
153+
| [YouTube](https://developers.google.com/oauthplayground/) | [link](https://console.developers.google.com/apis/credentials) | [link](https://myaccount.google.com/connections) | 2 ||| | | | |
154154

155155
**Legend:**
156156
- **Provider**: the name of the provider class and link to their API documentation

docs/Basics/Overview.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fully [PSR-7](https://www.php-fig.org/psr/psr-7/)/[PSR-17](https://www.php-fig.o
5555
| [Gitea](https://docs.gitea.com/api/1.20/) | [link](https://gitea.com/user/settings/applications) | [link](https://gitea.com/user/settings/applications) | 2 |||| || |
5656
| [GitHub](https://docs.github.com/rest) | [link](https://github.com/settings/developers) | [link](https://github.com/settings/applications) | 2 ||| | || |
5757
| [GitLab](https://docs.gitlab.com/ee/api/rest/) | [link](https://gitlab.com/profile/applications) | | 2 ||| ||| |
58-
| [Google](https://developers.google.com/oauthplayground/) | [link](https://console.developers.google.com/apis/credentials) | [link](https://myaccount.google.com/connections) | 2 ||| | | | |
58+
| [Google](https://developers.google.com/oauthplayground/) | [link](https://console.developers.google.com/apis/credentials) | [link](https://myaccount.google.com/connections) | 2 ||| | | | |
5959
| [GuildWars2](https://wiki.guildwars2.com/wiki/API:Main) | [link](https://account.arena.net/applications) | [link](https://account.arena.net/applications) | 2 || | | | | |
6060
| [Imgur](https://apidocs.imgur.com) | [link](https://api.imgur.com/oauth2/addclient) | [link](https://imgur.com/account/settings/apps) | 2 ||| | || |
6161
| [LastFM](https://www.last.fm/api/) | [link](https://www.last.fm/api/account/create) | [link](https://www.last.fm/settings/applications) | - || | | | | |
@@ -85,7 +85,7 @@ fully [PSR-7](https://www.php-fig.org/psr/psr-7/)/[PSR-17](https://www.php-fig.o
8585
| [TwitterCC](https://developer.twitter.com/en/docs/basics/authentication/overview/application-only) | [link](https://developer.twitter.com/apps) | [link](https://twitter.com/settings/applications) | 2 | | | || | |
8686
| [Vimeo](https://developer.vimeo.com) | [link](https://developer.vimeo.com/apps) | [link](https://vimeo.com/settings/apps) | 2 ||| || ||
8787
| [WordPress](https://developer.wordpress.com/docs/api/) | [link](https://developer.wordpress.com/apps/) | [link](https://wordpress.com/me/security/connected-applications) | 2 ||| | | | |
88-
| [YouTube](https://developers.google.com/oauthplayground/) | [link](https://console.developers.google.com/apis/credentials) | [link](https://myaccount.google.com/connections) | 2 ||| | | | |
88+
| [YouTube](https://developers.google.com/oauthplayground/) | [link](https://console.developers.google.com/apis/credentials) | [link](https://myaccount.google.com/connections) | 2 ||| | | | |
8989

9090
**Legend:**
9191
- **Provider**: the name of the provider class and link to their API documentation

src/Providers/Google.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace chillerlan\OAuth\Providers;
1515

16-
use chillerlan\OAuth\Core\{AuthenticatedUser, CSRFToken, OAuth2Provider, UserInfo};
16+
use chillerlan\OAuth\Core\{AuthenticatedUser, CSRFToken, OAuth2Provider, PKCE, TokenInvalidate, UserInfo};
1717

1818
/**
1919
* Google OAuth2
@@ -22,7 +22,7 @@
2222
* @link https://developers.google.com/identity/protocols/oauth2/service-account
2323
* @link https://developers.google.com/oauthplayground/
2424
*/
25-
class Google extends OAuth2Provider implements CSRFToken, UserInfo{
25+
class Google extends OAuth2Provider implements CSRFToken, PKCE, TokenInvalidate, UserInfo{
2626

2727
public const IDENTIFIER = 'GOOGLE';
2828

@@ -37,7 +37,8 @@ class Google extends OAuth2Provider implements CSRFToken, UserInfo{
3737
];
3838

3939
protected string $authorizationURL = 'https://accounts.google.com/o/oauth2/auth';
40-
protected string $accessTokenURL = 'https://accounts.google.com/o/oauth2/token';
40+
protected string $accessTokenURL = 'https://oauth2.googleapis.com/token';
41+
protected string $revokeURL = 'https://oauth2.googleapis.com/revoke';
4142
protected string $apiURL = 'https://www.googleapis.com';
4243
protected string|null $userRevokeURL = 'https://myaccount.google.com/connections';
4344
protected string|null $apiDocs = 'https://developers.google.com/oauthplayground/';

0 commit comments

Comments
 (0)