Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Drupal\miniorange_oauth_client\GrantTypes; use Drupal\miniorange_o..

Decoded Output download

<?php 
 
 
namespace Drupal\miniorange_oauth_client\GrantTypes; 
 
use Drupal\miniorange_oauth_client\Controller\miniorange_oauth_clientController; 
use Drupal\miniorange_oauth_client\GrantTypes\HandleJWT; 
use Drupal\miniorange_oauth_client\Utilities; 
use Symfony\Component\HttpFoundation\RedirectResponse; 
class ImplicitGrant 
{ 
    public $appname; 
    public function __construct($BS) 
    { 
        $this->appname = $BS; 
    } 
    public function mo_oauth_client_mo_login($PN, $d0, $Ww) 
    { 
        $xM = isset($Ww["state"]) ? $Ww["state"] : ''; 
        $KL = Utilities::decodeState($xM); 
        $GF = isset($KL["testsso"]) ? $KL["testsso"] === true ? true : false : false; 
        $uE = $this->getresourceowner($PN, $d0, $GF); 
        $N8 = miniorange_oauth_clientController::flattenArray($uE); 
        if (!($GF || isset($_COOKIE["mo_testConfig"]))) { 
            goto KN; 
        } 
        miniorange_oauth_clientController::Test_Configuration($N8, $PN->appName); 
        KN: 
        return miniorange_oauth_clientController::performSSOinDrupal($uE, $N8, $PN, $Ww, $xM); 
    } 
    public function mo_oauth_client_initiateLogin($PN, $fn, $GF = false) 
    { 
        \Drupal::service("page_cache_kill_switch")->trigger(); 
        $mQ = \Drupal::moduleHandler(); 
        $Gz = $PN->getAllConfig(); 
        $mh = $Gz["authorizeEndpoint"]; 
        $i9 = Utilities::base64url_encode(random_bytes(12)); 
        $qO = Utilities::getCallbackUrl($Gz["appName"]); 
        $xM = Utilities::generateState($Gz["appName"], $fn, $GF); 
        $Qq = $PN->get_appType(); 
        $U1 = $PN->loginflowtype; 
        if ($Qq == "Custom_Open_id" || $U1 == "OpenID") { 
            goto vS; 
        } 
        $HX = "token"; 
        goto Qu; 
        vS: 
        $HX = "id_token"; 
        Qu: 
        if (strpos($mh, "?") !== false) { 
            goto Hl; 
        } 
        $mh = $mh . "?client_id=" . $PN->get_clientId() . "&scope=" . $Gz["scope"] . "&redirect_uri=" . $qO . "&response_type=" . $HX . "&state=" . $xM . "&nonce=" . $i9; 
        goto Oh; 
        Hl: 
        $mh = $mh . "&client_id=" . $PN->get_clientId() . "&scope=" . $Gz["scope"] . "&redirect_uri=" . $qO . "&response_type=" . $HX . "&state=" . $xM . "&nonce=" . $i9; 
        Oh: 
        if (!(session_status() == PHP_SESSION_NONE)) { 
            goto JK; 
        } 
        session_start(); 
        JK: 
        $BG = \Drupal::service("session"); 
        $BG->set("oauth2state", $xM); 
        $BG->set("appname", $Gz["appName"]); 
        $BG->set("nonce", $i9); 
        $BG->set("request_time", \Drupal::time()->getRequestTime()); 
        $mQ->invokeAll("mo_pre_authorization_request", [&$mh, $_GET]); 
        $Wy = new RedirectResponse($mh); 
        $Wy->send(); 
        exit; 
    } 
    public function getresourceowner($PN, $d0, $GF = false) 
    { 
        $Qq = $PN->get_appType(); 
        $U1 = $PN->loginflowtype; 
        $Rk = ''; 
        if ($Qq == "Custom_Open_id" || $U1 == "OpenID") { 
            goto md; 
        } 
        $GW = $PN->get_userInfoEndpoint(); 
        if (!(substr($GW, -1) == "=")) { 
            goto sb; 
        } 
        $GW .= $d0; 
        sb: 
        $Rk = miniorange_oauth_clientController::getResourceOwner($GW, $d0, $GF); 
        $hR = \Drupal::config("miniorange_oauth_client.settings")->get("miniorange_oauth_client_group_info_ep_" . $PN->appName); 
        if (empty($hR)) { 
            goto DR; 
        } 
        $vD = Utilities::getGroupsInfo($hR, $d0, $GF); 
        $vD = !empty($vD) ? $vD : []; 
        $Rk = array_merge($Rk, $vD); 
        DR: 
        goto g1; 
        md: 
        $H6 = new HandleJWT($PN, $d0, $GF); 
        $Rk = $H6->getUserAttributesFromIDToken(); 
        g1: 
        return $Rk; 
    } 
    public static function validate_token_and_state($Ww) 
    { 
        $d0 = isset($Ww["access_token"]) && !empty($Ww["access_token"]) ? $Ww["access_token"] : ''; 
        if (!empty($d0)) { 
            goto v7; 
        } 
        $d0 = isset($Ww["id_token"]) && !empty($Ww["id_token"]) ? $Ww["id_token"] : ''; 
        v7: 
        if (!empty($d0)) { 
            goto aB; 
        } 
        $d0 = isset($Ww["token"]) && !empty($Ww["token"]) ? $Ww["token"] : ''; 
        aB: 
        $xM = isset($Ww["state"]) ? $Ww["state"] : ''; 
        $KL = Utilities::decodeState($xM); 
        $GF = isset($KL["testsso"]) ? $KL["testsso"] === true ? true : false : false; 
        $BG = \Drupal::service("session"); 
        $w1 = $BG->get("oauth2state"); 
        $BG->remove("oauth2state"); 
        setrawcookie("login_query", '', \Drupal::time()->getRequestTime() - 1); 
        if (!(!empty($xM) && !empty($w1) && str_replace("=", '', $xM) != str_replace("=", '', $w1))) { 
            goto yW; 
        } 
        \Drupal::logger("miniorange_oauth_client")->error("State stored => <pre><code>" . print_r($w1, true) . "<pre><code>"); 
        \Drupal::logger("miniorange_oauth_client")->error("State parameter recieved => <pre><code>" . print_r($xM, true) . "<pre><code>"); 
        \Drupal::logger("miniorange_oauth_client")->error("Invalid State parameter.<pre><code>" . print_r($Ww, true) . "<pre><code>"); 
        if ($GF) { 
            goto Qq; 
        } 
        Utilities::anonymousRedirect(); 
        goto Om; 
        Qq: 
        Utilities::show_error_message_testconfig("Invalid State parameter.<pre><code>" . print_r($Ww, true) . "<pre><code>"); 
        Om: 
        yW: 
        if (!empty($d0)) { 
            goto Fo; 
        } 
        \Drupal::logger("miniorange_oauth_client")->error("Invalid Response <pre><code>" . print_r($Ww, true) . "<pre><code>"); 
        if ($GF) { 
            goto eZ; 
        } 
        Utilities::anonymousRedirect(); 
        goto hn; 
        eZ: 
        Utilities::show_error_message_testconfig("Invalid Response <pre><code>" . print_r($Ww, true) . "<pre><code>"); 
        hn: 
        Fo: 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php


namespace Drupal\miniorange_oauth_client\GrantTypes;

use Drupal\miniorange_oauth_client\Controller\miniorange_oauth_clientController;
use Drupal\miniorange_oauth_client\GrantTypes\HandleJWT;
use Drupal\miniorange_oauth_client\Utilities;
use Symfony\Component\HttpFoundation\RedirectResponse;
class ImplicitGrant
{
    public $appname;
    public function __construct($BS)
    {
        $this->appname = $BS;
    }
    public function mo_oauth_client_mo_login($PN, $d0, $Ww)
    {
        $xM = isset($Ww["\x73\x74\x61\x74\145"]) ? $Ww["\163\x74\x61\x74\145"] : '';
        $KL = Utilities::decodeState($xM);
        $GF = isset($KL["\164\x65\x73\164\x73\163\x6f"]) ? $KL["\x74\x65\x73\164\163\x73\x6f"] === true ? true : false : false;
        $uE = $this->getresourceowner($PN, $d0, $GF);
        $N8 = miniorange_oauth_clientController::flattenArray($uE);
        if (!($GF || isset($_COOKIE["\155\x6f\x5f\x74\x65\163\164\x43\157\x6e\x66\x69\x67"]))) {
            goto KN;
        }
        miniorange_oauth_clientController::Test_Configuration($N8, $PN->appName);
        KN:
        return miniorange_oauth_clientController::performSSOinDrupal($uE, $N8, $PN, $Ww, $xM);
    }
    public function mo_oauth_client_initiateLogin($PN, $fn, $GF = false)
    {
        \Drupal::service("\160\141\x67\145\137\x63\141\143\150\x65\137\x6b\x69\x6c\x6c\137\163\x77\x69\x74\143\x68")->trigger();
        $mQ = \Drupal::moduleHandler();
        $Gz = $PN->getAllConfig();
        $mh = $Gz["\x61\x75\164\150\x6f\162\151\x7a\x65\105\x6e\x64\x70\157\151\156\x74"];
        $i9 = Utilities::base64url_encode(random_bytes(12));
        $qO = Utilities::getCallbackUrl($Gz["\x61\160\x70\x4e\141\155\145"]);
        $xM = Utilities::generateState($Gz["\141\160\x70\x4e\141\155\x65"], $fn, $GF);
        $Qq = $PN->get_appType();
        $U1 = $PN->loginflowtype;
        if ($Qq == "\103\165\163\164\x6f\155\137\x4f\160\145\156\137\151\x64" || $U1 == "\x4f\x70\x65\x6e\111\104") {
            goto vS;
        }
        $HX = "\164\x6f\x6b\145\x6e";
        goto Qu;
        vS:
        $HX = "\x69\x64\x5f\x74\157\153\145\x6e";
        Qu:
        if (strpos($mh, "\77") !== false) {
            goto Hl;
        }
        $mh = $mh . "\77\x63\154\x69\x65\x6e\164\x5f\151\x64\75" . $PN->get_clientId() . "\46\163\x63\x6f\160\145\x3d" . $Gz["\163\143\157\160\x65"] . "\46\162\x65\x64\151\x72\145\x63\164\x5f\165\162\x69\x3d" . $qO . "\46\162\x65\x73\160\157\x6e\x73\145\x5f\164\171\x70\145\x3d" . $HX . "\46\x73\x74\141\164\x65\x3d" . $xM . "\46\156\157\156\x63\x65\75" . $i9;
        goto Oh;
        Hl:
        $mh = $mh . "\46\143\154\151\145\156\x74\x5f\151\x64\x3d" . $PN->get_clientId() . "\46\163\143\x6f\x70\x65\75" . $Gz["\x73\x63\x6f\x70\145"] . "\x26\162\145\x64\151\162\145\143\164\137\165\x72\x69\x3d" . $qO . "\x26\162\145\163\x70\157\x6e\163\x65\x5f\164\171\x70\x65\x3d" . $HX . "\46\x73\x74\x61\164\x65\x3d" . $xM . "\46\156\x6f\156\143\x65\x3d" . $i9;
        Oh:
        if (!(session_status() == PHP_SESSION_NONE)) {
            goto JK;
        }
        session_start();
        JK:
        $BG = \Drupal::service("\163\145\163\x73\151\157\x6e");
        $BG->set("\x6f\x61\165\164\150\x32\x73\164\x61\164\145", $xM);
        $BG->set("\x61\x70\x70\x6e\x61\x6d\x65", $Gz["\x61\160\x70\116\x61\155\145"]);
        $BG->set("\x6e\x6f\x6e\143\145", $i9);
        $BG->set("\x72\x65\x71\165\x65\163\164\x5f\x74\151\155\x65", \Drupal::time()->getRequestTime());
        $mQ->invokeAll("\155\157\x5f\x70\x72\x65\137\x61\x75\x74\x68\x6f\x72\x69\172\x61\x74\151\x6f\x6e\x5f\x72\145\161\x75\x65\x73\x74", [&$mh, $_GET]);
        $Wy = new RedirectResponse($mh);
        $Wy->send();
        exit;
    }
    public function getresourceowner($PN, $d0, $GF = false)
    {
        $Qq = $PN->get_appType();
        $U1 = $PN->loginflowtype;
        $Rk = '';
        if ($Qq == "\x43\x75\x73\x74\x6f\x6d\x5f\x4f\x70\x65\156\x5f\x69\x64" || $U1 == "\x4f\160\145\156\x49\104") {
            goto md;
        }
        $GW = $PN->get_userInfoEndpoint();
        if (!(substr($GW, -1) == "\x3d")) {
            goto sb;
        }
        $GW .= $d0;
        sb:
        $Rk = miniorange_oauth_clientController::getResourceOwner($GW, $d0, $GF);
        $hR = \Drupal::config("\x6d\x69\x6e\151\157\x72\x61\x6e\147\x65\137\x6f\141\165\164\x68\x5f\x63\154\x69\x65\x6e\164\x2e\x73\x65\x74\164\151\x6e\147\x73")->get("\x6d\151\x6e\151\x6f\162\x61\x6e\x67\145\x5f\157\141\x75\164\x68\x5f\143\154\x69\x65\156\x74\137\147\162\x6f\165\x70\137\151\x6e\146\x6f\137\145\160\137" . $PN->appName);
        if (empty($hR)) {
            goto DR;
        }
        $vD = Utilities::getGroupsInfo($hR, $d0, $GF);
        $vD = !empty($vD) ? $vD : [];
        $Rk = array_merge($Rk, $vD);
        DR:
        goto g1;
        md:
        $H6 = new HandleJWT($PN, $d0, $GF);
        $Rk = $H6->getUserAttributesFromIDToken();
        g1:
        return $Rk;
    }
    public static function validate_token_and_state($Ww)
    {
        $d0 = isset($Ww["\x61\143\x63\145\x73\x73\x5f\164\x6f\153\145\156"]) && !empty($Ww["\141\x63\143\x65\x73\x73\x5f\164\x6f\153\145\156"]) ? $Ww["\141\143\143\145\163\163\137\164\157\x6b\x65\156"] : '';
        if (!empty($d0)) {
            goto v7;
        }
        $d0 = isset($Ww["\x69\144\137\x74\x6f\x6b\145\x6e"]) && !empty($Ww["\151\144\x5f\x74\x6f\x6b\145\x6e"]) ? $Ww["\x69\x64\x5f\x74\x6f\153\145\x6e"] : '';
        v7:
        if (!empty($d0)) {
            goto aB;
        }
        $d0 = isset($Ww["\164\x6f\x6b\145\156"]) && !empty($Ww["\x74\x6f\x6b\145\x6e"]) ? $Ww["\164\x6f\153\x65\x6e"] : '';
        aB:
        $xM = isset($Ww["\x73\164\141\164\x65"]) ? $Ww["\x73\x74\141\164\145"] : '';
        $KL = Utilities::decodeState($xM);
        $GF = isset($KL["\164\x65\163\164\163\x73\x6f"]) ? $KL["\164\x65\x73\x74\x73\163\157"] === true ? true : false : false;
        $BG = \Drupal::service("\163\145\163\x73\151\x6f\x6e");
        $w1 = $BG->get("\157\141\x75\x74\150\x32\x73\x74\x61\164\x65");
        $BG->remove("\x6f\141\165\x74\x68\62\163\164\x61\164\x65");
        setrawcookie("\154\x6f\x67\151\x6e\137\x71\x75\x65\x72\171", '', \Drupal::time()->getRequestTime() - 1);
        if (!(!empty($xM) && !empty($w1) && str_replace("\75", '', $xM) != str_replace("\75", '', $w1))) {
            goto yW;
        }
        \Drupal::logger("\155\x69\x6e\x69\157\162\x61\x6e\147\145\x5f\x6f\141\x75\x74\150\x5f\x63\x6c\x69\145\x6e\x74")->error("\123\164\x61\164\145\40\163\x74\x6f\162\x65\144\40\x3d\76\40\74\x70\162\x65\76\x3c\143\x6f\x64\x65\x3e" . print_r($w1, true) . "\74\160\162\x65\76\74\143\157\x64\x65\x3e");
        \Drupal::logger("\155\151\x6e\x69\157\162\141\x6e\147\145\137\157\x61\165\164\150\137\143\x6c\151\x65\x6e\x74")->error("\x53\164\141\x74\x65\40\160\x61\x72\x61\x6d\145\x74\x65\x72\x20\x72\x65\143\151\145\166\145\x64\x20\75\76\x20\x3c\160\x72\145\x3e\74\x63\157\144\x65\76" . print_r($xM, true) . "\x3c\x70\162\x65\76\74\143\157\144\145\x3e");
        \Drupal::logger("\155\151\156\151\157\162\x61\156\x67\145\x5f\157\x61\165\164\x68\x5f\x63\x6c\151\x65\x6e\164")->error("\111\156\x76\x61\154\x69\x64\40\123\164\141\x74\x65\x20\160\x61\x72\141\x6d\145\164\145\x72\56\x3c\160\x72\145\x3e\74\x63\x6f\144\145\76" . print_r($Ww, true) . "\74\160\162\x65\x3e\x3c\x63\157\144\145\76");
        if ($GF) {
            goto Qq;
        }
        Utilities::anonymousRedirect();
        goto Om;
        Qq:
        Utilities::show_error_message_testconfig("\x49\156\166\x61\154\x69\x64\40\x53\x74\141\164\x65\40\160\141\162\x61\155\145\164\145\162\56\x3c\160\162\145\x3e\74\x63\157\x64\145\76" . print_r($Ww, true) . "\x3c\160\x72\145\76\x3c\x63\x6f\x64\145\x3e");
        Om:
        yW:
        if (!empty($d0)) {
            goto Fo;
        }
        \Drupal::logger("\x6d\151\x6e\x69\x6f\x72\x61\x6e\x67\x65\x5f\157\141\165\164\150\137\x63\x6c\151\x65\x6e\x74")->error("\111\156\x76\x61\154\x69\144\x20\x52\145\163\x70\157\x6e\163\x65\40\x3c\x70\162\145\x3e\x3c\143\157\144\145\x3e" . print_r($Ww, true) . "\x3c\160\162\x65\76\x3c\x63\x6f\x64\145\76");
        if ($GF) {
            goto eZ;
        }
        Utilities::anonymousRedirect();
        goto hn;
        eZ:
        Utilities::show_error_message_testconfig("\111\x6e\166\x61\x6c\151\144\x20\122\145\x73\160\x6f\x6e\163\x65\40\74\x70\x72\x65\x3e\x3c\143\x6f\x64\x65\x3e" . print_r($Ww, true) . "\x3c\x70\x72\145\x3e\x3c\143\x6f\x64\145\76");
        hn:
        Fo:
    }
}

Function Calls

None

Variables

None

Stats

MD5 89c40057a147920c0a66f8c907c18e8a
Eval Count 0
Decode Time 69 ms