From eed7ef506105cabee47673017cfeb3db6966393d Mon Sep 17 00:00:00 2001 From: rx80 Date: Wed, 28 Jul 2021 12:50:34 +0000 Subject: [PATCH] Simplify use of get_oauth_token.php Add a form the user can fill in, avoiding the need to modify clientId and clientSecret in code. --- get_oauth_token.php | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/get_oauth_token.php b/get_oauth_token.php index befdc34a..961db531 100644 --- a/get_oauth_token.php +++ b/get_oauth_token.php @@ -45,13 +45,26 @@ use Hayageek\OAuth2\Client\Provider\Yahoo; //@see https://github.com/stevenmaguire/oauth2-microsoft use Stevenmaguire\OAuth2\Client\Provider\Microsoft; -if (!isset($_GET['code']) && !isset($_GET['provider'])) { +if (!isset($_GET['code']) && !isset($_POST['provider'])) { ?> -Select Provider:
-Google
-Yahoo
-Microsoft/Outlook/Hotmail/Live/Office365
+ +
+

Select Provider

+ +
+ +
+ +
+

Provide id and secret

+

These details are obtained by setting up an app in the Google developer console, + or whichever provider you're using. +

+ ClientId:
+ ClientSecret:
+ +