From d17ec703c2f83bd5b43e798e3edff64eba8a4726 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 31 May 2023 14:58:26 +0200 Subject: [PATCH] Plugin: OAuth2: Add alternative URLs as comments in the code (tested case with OKTA testing env) - refs BT#20611 --- plugin/oauth2/src/OAuth2.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/oauth2/src/OAuth2.php b/plugin/oauth2/src/OAuth2.php index f281b7bf9b..fff9bbe53e 100644 --- a/plugin/oauth2/src/OAuth2.php +++ b/plugin/oauth2/src/OAuth2.php @@ -139,10 +139,13 @@ class OAuth2 extends Plugin public function getProvider(): GenericProvider { + $redirectUri = api_get_path(WEB_PLUGIN_PATH).'oauth2/src/callback.php'; + // In cases not precisely defined yet, this alternative version might be necessary - see BT#20611 + //$redirectUri = api_get_path(WEB_PATH).'authorization-code/callback'; $options = [ 'clientId' => $this->get(self::SETTING_CLIENT_ID), 'clientSecret' => $this->get(self::SETTING_CLIENT_SECRET), - 'redirectUri' => api_get_path(WEB_PLUGIN_PATH).'oauth2/src/callback.php', + 'redirectUri' => $redirectUri, 'urlAuthorize' => $this->get(self::SETTING_AUTHORIZE_URL), 'urlResourceOwnerDetails' => $this->get(self::SETTING_RESOURCE_OWNER_DETAILS_URL), ]; @@ -310,6 +313,8 @@ class OAuth2 extends Plugin public function getSignInURL(): string { return api_get_path(WEB_PLUGIN_PATH).$this->get_name().'/src/callback.php'; + // In cases not precisely defined yet, this alternative version might be necessary - see BT#20611 + //return api_get_path(WEB_PATH).'authorization-code/callback'; } public function getLogoutUrl(): string