Skip to content

Commit d17ec70

Browse files
committed
Plugin: OAuth2: Add alternative URLs as comments in the code (tested case with OKTA testing env) - refs BT#20611
1 parent 286caf9 commit d17ec70

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugin/oauth2/src/OAuth2.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,13 @@ public static function create(): OAuth2
139139

140140
public function getProvider(): GenericProvider
141141
{
142+
$redirectUri = api_get_path(WEB_PLUGIN_PATH).'oauth2/src/callback.php';
143+
// In cases not precisely defined yet, this alternative version might be necessary - see BT#20611
144+
//$redirectUri = api_get_path(WEB_PATH).'authorization-code/callback';
142145
$options = [
143146
'clientId' => $this->get(self::SETTING_CLIENT_ID),
144147
'clientSecret' => $this->get(self::SETTING_CLIENT_SECRET),
145-
'redirectUri' => api_get_path(WEB_PLUGIN_PATH).'oauth2/src/callback.php',
148+
'redirectUri' => $redirectUri,
146149
'urlAuthorize' => $this->get(self::SETTING_AUTHORIZE_URL),
147150
'urlResourceOwnerDetails' => $this->get(self::SETTING_RESOURCE_OWNER_DETAILS_URL),
148151
];
@@ -310,6 +313,8 @@ public function getUserInfo(GenericProvider $provider, AccessToken $accessToken)
310313
public function getSignInURL(): string
311314
{
312315
return api_get_path(WEB_PLUGIN_PATH).$this->get_name().'/src/callback.php';
316+
// In cases not precisely defined yet, this alternative version might be necessary - see BT#20611
317+
//return api_get_path(WEB_PATH).'authorization-code/callback';
313318
}
314319

315320
public function getLogoutUrl(): string

0 commit comments

Comments
 (0)