/* Decoded by unphp.net */ messageManager = $R2; $this->resultFactory = $FM; $this->storeManager = $fA; $this->_state = $Pp; $this->serializer = $Y5; $this->passwordGrant = $nl; parent::__construct($nk, $qZ); } public function execute() { if (!$this->oauthUtility->isTrialExpired()) { goto fm; } $this->oauthUtility->log_debug("ProcessUserAction: execute : Your demo account has expired."); print_r("Your Demo account has expired. Please contact magentosupport@xecurify.com"); exit; fm: $oQ = false; $this->oauthUtility->log_debug("SendAuthorizationRequest: execute"); if (!(!$this->oauthUtility->micr() || !$this->oauthUtility->mclv())) { goto Ao; } return $this->getResponse()->setBody("Please Configure miniOrange OAuth module!"); Ao: $SB = $this->getRequest()->getParams(); $Ig = $SB["app_name"]; $this->oauthUtility->log_debug("SendAuthorizationRequest: app_name", $Ig); $this->oauthUtility->setSessionData(OAuthConstants::APP_NAME, $Ig); $this->oauthUtility->setAdminSessionData(OAuthConstants::APP_NAME, $Ig); $HU = $this->oauthUtility->getOAuthClientApps(); $XB = null; $this->oauthUtility->log_debug("SendAuthorizationRequest: collection :", count($HU)); foreach ($HU as $JZ) { if (!($JZ->getData()["app_name"] === $Ig)) { goto L2; } $XB = $JZ->getData(); L2: LJ: } ov: $this->oauthUtility->log_debug("SendAuthorizationRequest: clientDetails :" . json_encode($XB)); $this->oauthUtility->log_debug("SendAuthorizationRequest: Request params:" . json_encode($SB)); $Vs = array_key_exists("relayState", $SB) ? $SB["relayState"] : "/"; $CJ = $XB["grant_type"]; $Xh = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT); $eo = $this->oauthUtility->getBaseUrl(); $Jy = $eo . "mooauth/actions/ReadAuthorizationResponse"; $iu = $this->oauthUtility->isAutoRedirectEnabled($Ig); $ya = $this->oauthUtility->isAllPageAutoRedirectEnabled($Ig); if (!($iu && ($ya == NULL || $ya == 0) && $Vs != OAuthConstants::TEST_RELAYSTATE)) { goto KH; } $ca = $this->_request->getServer("HTTP_REFERER"); $this->oauthUtility->log_debug("SendAuthorizationRequest: previous url:" . $ca); if (is_null($ca)) { goto AF; } $Vs = preg_replace("/\/$/", '', $ca); AF: $this->oauthUtility->flushCache(); KH: $this->oauthUtility->setSessionData("error_redirect_url", $Vs); $kO = $this->oauthUtility->checkIfFlowStartedFromBackend($Vs); if ($Vs == OAuthConstants::TEST_RELAYSTATE) { goto xk; } $VK = $this->storeManager->getStore()->getWebsiteId(); $Dh = $this->oauthUtility->getStoreConfig(OAuthConstants::WEBSITE_IDS); $IV = $this->oauthUtility->getStoreConfig(OAuthConstants::WEBSITE_COUNT); $G5 = $this->oauthUtility->isBlank($Dh) ? array() : json_decode($Dh); $LE = $this->oauthUtility->getWebsiteLimit(); if ($this->oauthUtility->isBlank($G5)) { goto RM; } foreach ($G5 as $ed => $WS) { if (!($VK == $ed)) { goto ms; } $oQ = true; goto Tv; ms: QK: } Tv: RM: if (!(!$kO && ($oQ == false || $IV > $LE))) { goto IY; } print_r("You have not selected this website for SSO"); return; IY: goto Up; xk: $this->oauthUtility->setStoreConfig(OAuthConstants::IS_TEST, true); $this->oauthUtility->flushCache(); Up: if (!($CJ == "password_grant")) { goto KI; } if (!($Vs == OAuthConstants::TEST_RELAYSTATE)) { goto Vi; } $Xh->setUrl($this->oauthUtility->getBaseUrl() . "mooauth/actions/PasswordGrant?relayState=" . $Vs); return $Xh; Vi: $Xh->setUrl($this->oauthUtility->getBaseUrl() . "customer/account/login/?relayState=" . $Vs); return $Xh; KI: if (isset($XB["authorize_endpoint"])) { goto pS; } return; pS: $hc = $XB["clientID"]; $a0 = $XB["scope"]; $iI = $XB["authorize_endpoint"]; $qS = OAuthConstants::CODE; $eo = $this->oauthUtility->getBaseUrl(); $Jy = $this->oauthUtility->getBaseUrl() . OAuthConstants::CALLBACK_URL; $FU = $XB["pkce_flow"] == 1 ? true : false; $nO = ''; if (!$FU) { goto LX; } $zM = bin2hex(openssl_random_pseudo_bytes(32)); $TY = $this->oauthUtility->base64url_encode(pack("H*", $zM)); $_SESSION["mo_code_verifier"] = $TY; $nO = $this->oauthUtility->base64url_encode(pack("H*", hash("sha256", $TY))); LX: $this->oauthUtility->log_debug("SendAuthorizationRequest: scope:", $a0); $this->oauthUtility->log_debug("SendAuthorizationRequest: authorizeURL:", $iI); $this->oauthUtility->log_debug("SendAuthorizationRequest: responseType:", $qS); $this->oauthUtility->log_debug("SendAuthorizationRequest: currentBaseUrl:", $eo); $this->oauthUtility->log_debug("SendAuthorizationRequest: redirectURL:", $Jy); $EI = new AuthorizationRequest($hc, $a0, $iI, $qS, $Jy, $Vs, $FU, $nO); $A2 = $EI->build(); $this->oauthUtility->log_debug("SendAuthorizationRequest: Authorization Request:", $A2); return $this->sendHTTPRedirectRequest($A2, $iI); } } ?>