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 MoOauthClient\Premium; use MoOauthClient\Standard\LoginHandler as ..
Decoded Output download
<?php
namespace MoOauthClient\Premium;
use MoOauthClient\Standard\LoginHandler as StandardLoginHandler;
use MoOauthClient\GrantTypes\Implicit;
use MoOauthClient\GrantTypes\Password;
use MoOauthClient\GrantTypes\JWSVerify;
use MoOauthClient\GrantTypes\JWTUtils;
use MoOauthClient\Premium\MappingHandler;
use MoOauthClient\StorageManager;
use MoOauthClient\MO_Oauth_Debug;
class LoginHandler extends StandardLoginHandler
{
private $implicit_handler;
private $app_name = '';
private $group_mapping_attr = false;
private $resource_owner = false;
public function __construct()
{
global $Rg;
parent::__construct();
add_filter("mo_auth_url_internal", array($this, "mo_oauth_client_generate_authorization_url"), 5, 2);
add_action("wp_footer", array($this, "mo_oauth_client_implicit_fragment_handler"));
add_action("mo_oauth_restrict_emails", array($this, "mo_oauth_client_restrict_emails"), 10, 2);
add_action("mo_oauth_client_map_roles", array($this, "mo_oauth_client_map_roles"), 10, 1);
$LF = $Rg->mo_oauth_client_get_option("mo_oauth_enable_oauth_wp_login");
if (!$LF) {
goto vrd;
}
remove_filter("authenticate", "wp_authenticate_username_password", 20, 3);
$vK = new Password(true);
add_filter("authenticate", array($vK, "mo_oauth_wp_login"), 20, 3);
vrd:
}
public function mo_oauth_client_restrict_emails($B7, $gL)
{
global $Rg;
$Yr = isset($gL["restricted_domains"]) ? $gL["restricted_domains"] : '';
if (!empty($Yr)) {
goto o07;
}
return;
o07:
$WD = isset($gL["allow_restricted_domains"]) ? $gL["allow_restricted_domains"] : '';
if (!empty($WD)) {
goto TLm;
}
$WD = false;
TLm:
$WD = intval($WD);
$Yr = array_map("trim", explode(",", strtolower($Yr)));
$Fi = strtolower(substr($B7, strpos($B7, "@") + 1));
$NH = in_array($Fi, $Yr, false);
$NH = $WD ? !$NH : $NH;
$nK = !empty($Yr) && $NH;
if (!$nK) {
goto Xcm;
}
$qh = "You do not have rights to access this page. Please contact the administrator.";
$Rg->handle_error($qh);
wp_die($qh);
Xcm:
}
public function mo_oauth_client_generate_authorization_url($sx, $P8)
{
global $Rg;
$iQ = $Rg->parse_url($sx);
$gL = $Rg->get_app_by_name($P8)->get_app_config();
$U5 = md5(rand());
setcookie("mo_oauth_nonce", $U5, time() + 120, "/", null, true, true);
if (isset($gL["grant_type"]) && "Implicit Grant" === $gL["grant_type"]) {
goto Ih3;
}
if (!(isset($gL["grant_type"]) && "Hybrid Grant" === $gL["grant_type"])) {
goto nic;
}
MO_Oauth_Debug::mo_oauth_log("Grant: Hybrid Grant");
$xZ = isset($gL["mo_oauth_response_type"]) && !empty($gL["mo_oauth_response_type"]) ? $gL["mo_oauth_response_type"] : "token%20id_token%20code";
$iQ["query"]["response_type"] = $xZ;
return $Rg->generate_url($iQ);
nic:
goto ElI;
Ih3:
$iQ["query"]["nonce"] = $U5;
$iQ["query"]["response_type"] = "token";
$xZ = isset($gL["mo_oauth_response_type"]) && !empty($gL["mo_oauth_response_type"]) ? $gL["mo_oauth_response_type"] : "token";
$iQ["query"]["response_type"] = $xZ;
return $Rg->generate_url($iQ);
ElI:
return $sx;
}
public function mo_oauth_client_map_roles($CF)
{
$NY = isset($CF["app_config"]) && !empty($CF["app_config"]) ? $CF["app_config"] : [];
$if = isset($NY["groupname_attribute"]) && '' !== $NY["groupname_attribute"] ? $NY["groupname_attribute"] : false;
$XT = isset($CF["new_user"]) && !empty($CF["new_user"]) ? $CF["new_user"] : 0;
global $Rg;
$I3 = false;
if (isset($NY["enable_role_mapping"])) {
goto I7E;
}
$NY["enable_role_mapping"] = true;
$I3 = true;
I7E:
if (isset($NY["_mapping_value_default"])) {
goto rcq;
}
$NY["_mapping_value_default"] = "subscriber";
$I3 = true;
rcq:
if (!boolval($I3)) {
goto k9C;
}
if (!(isset($NY["client_creds_encrpyted"]) && boolval($NY["client_creds_encrpyted"]))) {
goto nHW;
}
$NY["client_id"] = $Rg->mooauthencrypt($NY["client_id"]);
$NY["client_secret"] = $Rg->mooauthencrypt($NY["client_secret"]);
nHW:
$Rg->set_app_by_name($CF["app_name"], $NY);
k9C:
$this->resource_owner = isset($CF["resource_owner"]) && !empty($CF["resource_owner"]) ? $CF["resource_owner"] : [];
$this->group_mapping_attr = $this->get_group_mapping_attribute($this->resource_owner, false, $if);
if (!(isset($NY["extract_email_domain_for_rolemapping"]) && boolval($NY["extract_email_domain_for_rolemapping"]))) {
goto yPL;
}
if (!is_array($this->group_mapping_attr) && is_email($this->group_mapping_attr)) {
goto H7m;
}
MO_Oauth_Debug::mo_oauth_log("Email address not received in the configured group attribute name as the option is enabled to extract domain when email is mapped for role mapping. Check your Role Mapping configuration.");
$Rg->handle_error("Email domain not received. Check your <strong>Role Mapping</strong> configuration.");
wp_die("Email domain not received. Check your <strong>Role Mapping</strong> configuration.");
goto is0;
H7m:
$this->group_mapping_attr = substr($this->group_mapping_attr, strpos($this->group_mapping_attr, "@") + 1);
is0:
yPL:
MO_Oauth_Debug::mo_oauth_log("Group Mapping Attributes => " . $if);
$Sa = new MappingHandler(isset($CF["user_id"]) && is_numeric($CF["user_id"]) ? intval($CF["user_id"]) : 0, $NY, isset($this->group_mapping_attr) ? $this->group_mapping_attr : '', isset($CF["new_user"]) ? \boolval($CF["new_user"]) : true);
$gL = $CF["config"];
if (!($XT || (!isset($gL["keep_existing_users"]) || 1 !== intval($gL["keep_existing_users"])))) {
goto JGs;
}
$Sa->apply_custom_attribute_mapping(is_array($this->resource_owner) ? $this->resource_owner : []);
JGs:
$Wz = false;
$Wz = apply_filters("mo_oauth_client_update_admin_role", $Wz);
if (!$Wz) {
goto PCA;
}
MO_Oauth_Debug::mo_oauth_log("Admin Role will be updated");
PCA:
if (!(user_can($CF["user_id"], "administrator") && !$Wz)) {
goto MyG;
}
return;
MyG:
$Sa->apply_role_mapping(is_array($this->resource_owner) ? $this->resource_owner : []);
}
public function mo_oauth_client_implicit_fragment_handler()
{
echo " \x9\x9<script>\xa \x9 \x9function convert_to_url(obj) {
\x9\x9 return Object\xa\x9 \x9.keys(obj)\xa\x9\x9 \x9 .map(k => `${encodeURIComponent(k)}=${encodeURIComponent(obj[k])}`)
\x9 .join('&');\xa\x9\x9 }
\xa\x9 \x9 function pass_to_backend() {\xa \x9\x9if(window.location.hash) {
\x9 \x9 \x9var hash = window.location.hash;\xa \x9\x9\x9 var elements = {};\xa\x9\x9 \x9 \x9hash.split("#")[1].split("&").forEach(element => {\xa\x9\x9\x9 var vars = element.split("=");
\x9\x9\x9\x9 \x9\x9elements[vars[0]] = vars[1];\xa\x9\x9\x9\x9\x9\x9});
\x9 \x9 if(("access_token" in elements) || ("id_token" in elements) || ("token" in elements)) {
\x9 \x9\x9 if(window.location.href.indexOf("?") !== -1) {
\x9 \x9\x9\x9\x9 window.location = (window.location.href.split("?")[0] + window.location.hash).split('#')[0] + "?" + convert_to_url(elements);
\x9 \x9\x9 \x9} else {\xa \x9\x9\x9 \x9\x9 window.location = window.location.href.split('#')[0] + "?" + convert_to_url(elements);
\x9 \x9 \x9}\xa\x9\x9\x9 \x9 }
\x9 \x9 }
\x9 \x9}\xa\xa\x9 \x9\x9pass_to_backend();\xa \x9</script>
\x9";
}
private function check_state($QA)
{
global $Rg;
$OC = str_replace("%3d", "=", urldecode($QA->get_query_param("state")));
if (empty($OC) && isset($_COOKIE["state_param"])) {
goto GIj;
}
if (isset($_GET["state"]) && !empty($_GET["state"])) {
goto ej8;
}
goto GS8;
GIj:
$OC = $_COOKIE["state_param"];
goto GS8;
ej8:
$OC = wp_unslash($_GET["state"]);
GS8:
$c8 = new StorageManager($OC);
$vR = $c8->get_value("appname");
$NY = $Rg->get_app_by_name($vR)->get_app_config();
$Xq = $NY["appId"];
$s2 = $Rg->get_app_by_name($Xq);
if (!is_wp_error($c8)) {
goto IU0;
}
$Rg->handle_error($c8->get_error_message());
wp_die(wp_kses($c8->get_error_message(), \mo_oauth_get_valid_html()));
IU0:
$Ll = $c8->get_value("uid");
if (!($Ll && MO_UID === $Ll)) {
goto ILh;
}
$this->appname = $c8->get_value("appname");
return $c8;
ILh:
return false;
}
public function mo_oauth_login_validate()
{
if (isset($_REQUEST["mo_login_popup"]) && 1 == sanitize_text_field($_REQUEST["mo_login_popup"])) {
goto Ppd;
}
parent::mo_oauth_login_validate();
global $Rg;
if (!(isset($_REQUEST["token"]) && !empty($_REQUEST["token"]) || isset($_REQUEST["id_token"]) && !empty($_REQUEST["id_token"]))) {
goto qZS;
}
if (!(isset($_REQUEST["token"]) && !empty($_REQUEST["token"]))) {
goto LVT;
}
$zM = $Rg->is_valid_jwt(urldecode($_REQUEST["token"]));
if ($zM) {
goto tIi;
}
return;
tIi:
LVT:
if (!(isset($_REQUEST["nonce"]) && (isset($_COOKIE["mo_oauth_nonce"]) && $_COOKIE["mo_oauth_nonce"] != $_REQUEST["nonce"]))) {
goto ydg;
}
$Rg->handle_error("Nonce verification is failed. Please contact to your administrator.");
wp_die("Nonce verification is failed. Please contact to your administrator.");
exit;
ydg:
$QA = new Implicit(isset($_SERVER["QUERY_STRING"]) ? $_SERVER["QUERY_STRING"] : '');
if (!is_wp_error($QA)) {
goto g3V;
}
$Rg->handle_error($QA->get_error_message());
wp_die(wp_kses($QA->get_error_message(), \mo_oauth_get_valid_html()));
MO_Oauth_Debug::mo_oauth_log("Please try Logging in again.");
exit("Please try Logging in again.");
g3V:
$lb = $QA->get_jwt_from_query_param();
if (!is_wp_error($lb)) {
goto TAn;
}
$Rg->handle_error($lb->get_error_message());
MO_Oauth_Debug::mo_oauth_log($lb->get_error_message());
wp_die(wp_kses($lb->get_error_message(), \mo_oauth_get_valid_html()));
TAn:
MO_Oauth_Debug::mo_oauth_log("JWT Token used for obtaining resource owner => ");
MO_Oauth_Debug::mo_oauth_log($lb);
$c8 = $this->check_state($QA);
if ($c8) {
goto Q8Q;
}
$QK = "State Parameter did not verify. Please Try Logging in again.";
$Rg->handle_error($QK);
MO_Oauth_Debug::mo_oauth_log("State Parameter did not verify. Please Try Logging in again1.");
wp_die($QK);
Q8Q:
$NY = $Rg->get_app_by_name($this->app_name);
$NY = $NY ? $NY->get_app_config() : false;
$so = $this->handle_jwt($lb);
MO_Oauth_Debug::mo_oauth_log("Resource Owner => ");
MO_Oauth_Debug::mo_oauth_log($so);
if (!is_wp_error($so)) {
goto L1o;
}
$Rg->handle_error($so->get_error_message());
wp_die(wp_kses($so->get_error_message(), \mo_oauth_get_valid_html()));
L1o:
if ($NY) {
goto OWV;
}
$Q8 = "State Parameter did not verify. Please Try Logging in again2.";
$Rg->handle_error($Q8);
MO_Oauth_Debug::mo_oauth_log("State Parameter did not verify. Please Try Logging in again.");
wp_die($Q8);
OWV:
if ($so) {
goto ItC;
}
$hC = "JWT Signature did not verify. Please Try Logging in again.";
$Rg->handle_error($hC);
MO_Oauth_Debug::mo_oauth_log("JWT Signature did not verify. Please Try Logging in again.");
wp_die($hC);
ItC:
$CV = $c8->get_value("test_config");
$this->resource_owner = $so;
$this->handle_group_details($QA->get_query_param("access_token"), isset($NY["groupdetailsurl"]) ? $NY["groupdetailsurl"] : '', isset($NY["groupname_attribute"]) ? $NY["groupname_attribute"] : '', $CV);
$n_ = [];
$vc = $this->dropdownattrmapping('', $so, $n_);
$Rg->mo_oauth_client_update_option("mo_oauth_attr_name_list" . $NY["appId"], $vc);
if (!($CV && '' !== $CV)) {
goto xKu;
}
$this->render_test_config_output($so);
exit;
xKu:
MO_Oauth_Debug::mo_oauth_log("Before handle sso1");
$this->handle_sso($this->app_name, $NY, $so, $c8->get_state(), $QA->get_query_param());
qZS:
if (!(isset($_REQUEST["hublet"]) || isset($_REQUEST["portal_domain"]))) {
goto bSz;
}
return;
bSz:
if (!(isset($_REQUEST["access_token"]) && '' !== $_REQUEST["access_token"])) {
goto Ieq;
}
do_action("mo_oauth_check_custom_access_token", $_REQUEST);
$QA = new Implicit(isset($_SERVER["QUERY_STRING"]) ? $_SERVER["QUERY_STRING"] : '');
$c8 = $this->check_state($QA);
if ($c8) {
goto MLL;
}
$QK = "State Parameter did not verify. Please Try Logging in again.";
$Rg->handle_error($QK);
MO_Oauth_Debug::mo_oauth_log("State Parameter did not verify. Please Try Logging in again2.");
wp_die($QK);
MLL:
$NY = $Rg->get_app_by_name($c8->get_value("appname"));
$NY = $NY->get_app_config();
$so = [];
if (!(isset($NY["resourceownerdetailsurl"]) && !empty($NY["resourceownerdetailsurl"]))) {
goto p_7;
}
$so = $this->oauth_handler->get_resource_owner($NY["resourceownerdetailsurl"], $QA->get_query_param("access_token"));
p_7:
MO_Oauth_Debug::mo_oauth_log("Access Token => ");
MO_Oauth_Debug::mo_oauth_log($QA->get_query_param("access_token"));
$kb = [];
if (!$Rg->is_valid_jwt($QA->get_query_param("access_token"))) {
goto sWk;
}
$lb = $QA->get_jwt_from_query_param();
$kb = $this->handle_jwt($lb);
sWk:
if (empty($kb)) {
goto OJC;
}
$so = array_merge($so, $kb);
OJC:
if (!(empty($so) && !$Rg->is_valid_jwt($QA->get_query_param("access_token")))) {
goto IKZ;
}
$Rg->handle_error("Invalid Response Received.");
MO_Oauth_Debug::mo_oauth_log("Invalid Response Received");
wp_die("Invalid Response Received.");
exit;
IKZ:
$this->resource_owner = $so;
MO_Oauth_Debug::mo_oauth_log("Resource Owner => ");
MO_Oauth_Debug::mo_oauth_log($this->resource_owner);
$CV = $c8->get_value("test_config");
$this->handle_group_details($QA->get_query_param("access_token"), isset($NY["groupdetailsurl"]) ? $NY["groupdetailsurl"] : '', isset($NY["groupname_attribute"]) ? $NY["groupname_attribute"] : '', $CV);
$n_ = [];
$vc = $this->dropdownattrmapping('', $so, $n_);
$Rg->mo_oauth_client_update_option("mo_oauth_attr_name_list" . $NY["appId"], $vc);
if (!($CV && '' !== $CV)) {
goto NHU;
}
$this->render_test_config_output($so);
exit;
NHU:
$OC = str_replace("%3D", "=", rawurldecode($QA->get_query_param("state")));
$this->handle_sso($this->app_name, $NY, $so, $OC, $QA->get_query_param());
Ieq:
if (!(isset($_REQUEST["login"]) && "pwdgrntfrm" === $_REQUEST["login"])) {
goto PfQ;
}
$vK = new Password();
$MO = isset($_REQUEST["caller"]) && !empty($_REQUEST["caller"]) ? $_REQUEST["caller"] : false;
$SZ = isset($_REQUEST["tool"]) && !empty($_REQUEST["tool"]) ? $_REQUEST["tool"] : false;
$P8 = isset($_REQUEST["app_name"]) && !empty($_REQUEST["app_name"]) ? $_REQUEST["app_name"] : '';
if (!($P8 == '')) {
goto hB9;
}
$NE = "No such app found configured. Please check if you are sending the correct application name";
$Rg->handle_error($NE);
wp_die(wp_kses($NE, \mo_oauth_get_valid_html()));
exit;
hB9:
$Z3 = $Rg->mo_oauth_client_get_option("mo_oauth_apps_list");
if (is_array($Z3) && isset($Z3[$P8])) {
goto OfN;
}
$NE = "No such app found configured. Please check if you are sending the correct app_name";
$Rg->handle_error($NE);
wp_die(wp_kses($NE, \mo_oauth_get_valid_html()));
exit;
OfN:
$ZB = isset($_REQUEST["location"]) && !empty($_REQUEST["location"]) ? $_REQUEST["location"] : site_url();
$eO = isset($_REQUEST["test"]) && !empty($_REQUEST["test"]);
if (!(!$MO || !$SZ || !$P8)) {
goto BPH;
}
$Rg->redirect_user(urldecode($ZB));
BPH:
do_action("mo_oauth_custom_sso", $MO, $SZ, $P8, $ZB, $eO);
$vK->behave($MO, $SZ, $P8, $ZB, $eO);
PfQ:
goto l4t;
Ppd:
echo " <script type="text/javascript">
\x9\x9var base_url = "";
echo site_url();
echo "";\xa\x9\x9 var app_name = "";
echo sanitize_text_field($_REQUEST["app_name"]);
echo "";\xa\x9 \x9 var myWindow = window.open( base_url + '/?option=oauthredirect&app_name=' + app_name, '', 'width=500,height=500');
</script>
\x9\x9 \x9";
l4t:
}
public function handle_group_details($sI = '', $xi = '', $xC = '', $CV = false)
{
$Ac = [];
if (!('' === $sI || '' === $xC)) {
goto Hck;
}
return;
Hck:
if (!('' !== $xi)) {
goto rYW;
}
$Ac = $this->oauth_handler->get_resource_owner($xi, $sI);
if (!(isset($_COOKIE["mo_oauth_test"]) && $_COOKIE["mo_oauth_test"])) {
goto xFM;
}
if (!(is_array($Ac) && !empty($Ac))) {
goto B2g;
}
$this->render_test_config_output($Ac, true);
B2g:
return;
xFM:
rYW:
$if = $this->get_group_mapping_attribute($this->resource_owner, $Ac, $xC);
$this->group_mapping_attr = '' !== $if ? false : $if;
}
public function get_group_mapping_attribute($so = array(), $Ac = array(), $xC = '')
{
global $Rg;
$RV = '';
if (!('' === $xC)) {
goto tk1;
}
return '';
tk1:
if (isset($Ac) && !empty($Ac)) {
goto Y69;
}
if (isset($so) && !empty($so)) {
goto YY7;
}
goto i0T;
Y69:
$RV = $Rg->getnestedattribute($Ac, $xC);
goto i0T;
YY7:
$RV = $Rg->getnestedattribute($so, $xC);
i0T:
if (!($RV === 0 || $RV === "0")) {
goto SHd;
}
return $RV;
SHd:
return !empty($RV) ? $RV : '';
}
public function handle_jwt($lb)
{
global $Rg;
$s2 = $Rg->get_app_by_name($this->app_name);
$Xb = $s2->get_app_config("jwt_support");
if ($Xb) {
goto GcH;
}
return $lb->get_decoded_payload();
GcH:
$gK = $s2->get_app_config("jwt_algo");
if ($lb->check_algo($gK)) {
goto E7k;
}
return new \WP_Error("invalid_sign", __("JWT Signing algorithm is not allowed or unsupported."));
E7k:
$WG = "RSA" === $gK ? $s2->get_app_config("x509_cert") : $s2->get_app_config("client_secret");
$Nc = $s2->get_app_config("jwksurl");
$pZ = $Nc ? $lb->verify_from_jwks($Nc) : $lb->verify($WG);
return !$pZ ? $pZ : $lb->get_decoded_payload();
}
public function get_resource_owner_from_app($Rp, $s2)
{
global $Rg;
$this->app_name = $s2;
$lb = new JWTUtils($Rp);
if (!is_wp_error($lb)) {
goto exi;
}
$Rg->handle_error($lb->get_error_message());
wp_die($lb);
exi:
$so = $this->handle_jwt($lb);
if (!is_wp_error($so)) {
goto Lxc;
}
$Rg->handle_error($so->get_error_message());
wp_die($so);
Lxc:
if (!(false === $so)) {
goto kZQ;
}
$qh = "Failed to verify JWT Token. Please check your configuration or contact your Administrator.";
$Rg->handle_error($qh);
MO_Oauth_Debug::mo_oauth_log("Failed to verify JWT Token. Please check your configuration or contact your Administrator.");
wp_die($qh);
kZQ:
return $so;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace MoOauthClient\Premium;
use MoOauthClient\Standard\LoginHandler as StandardLoginHandler;
use MoOauthClient\GrantTypes\Implicit;
use MoOauthClient\GrantTypes\Password;
use MoOauthClient\GrantTypes\JWSVerify;
use MoOauthClient\GrantTypes\JWTUtils;
use MoOauthClient\Premium\MappingHandler;
use MoOauthClient\StorageManager;
use MoOauthClient\MO_Oauth_Debug;
class LoginHandler extends StandardLoginHandler
{
private $implicit_handler;
private $app_name = '';
private $group_mapping_attr = false;
private $resource_owner = false;
public function __construct()
{
global $Rg;
parent::__construct();
add_filter("\x6d\x6f\x5f\141\x75\x74\150\137\165\162\x6c\x5f\151\x6e\x74\x65\162\x6e\141\154", array($this, "\x6d\x6f\x5f\x6f\x61\165\x74\x68\x5f\x63\x6c\x69\x65\156\164\x5f\147\145\156\x65\x72\x61\x74\x65\137\141\165\x74\x68\157\x72\151\172\x61\x74\151\157\156\x5f\x75\162\x6c"), 5, 2);
add_action("\167\x70\x5f\146\157\x6f\164\x65\162", array($this, "\x6d\x6f\137\157\141\165\x74\x68\137\x63\x6c\151\x65\x6e\x74\x5f\151\155\x70\x6c\x69\143\151\x74\137\x66\x72\141\x67\x6d\x65\x6e\164\137\150\x61\x6e\144\154\145\x72"));
add_action("\x6d\x6f\137\157\x61\x75\x74\150\137\162\145\x73\x74\162\x69\x63\164\x5f\x65\x6d\141\x69\154\x73", array($this, "\155\157\x5f\157\x61\x75\x74\x68\x5f\143\x6c\151\x65\156\x74\137\x72\x65\x73\164\x72\151\143\164\137\x65\155\141\151\154\x73"), 10, 2);
add_action("\155\x6f\137\x6f\141\165\x74\x68\x5f\143\x6c\151\145\156\x74\137\155\141\160\x5f\162\x6f\x6c\145\163", array($this, "\x6d\x6f\137\157\x61\165\164\x68\137\143\x6c\151\145\156\x74\x5f\155\x61\x70\137\x72\157\x6c\x65\x73"), 10, 1);
$LF = $Rg->mo_oauth_client_get_option("\155\x6f\x5f\x6f\141\165\x74\x68\137\x65\156\141\142\x6c\145\x5f\x6f\141\165\x74\150\137\167\160\137\154\157\x67\x69\x6e");
if (!$LF) {
goto vrd;
}
remove_filter("\141\x75\x74\150\145\156\x74\x69\x63\x61\164\145", "\167\160\x5f\141\165\164\x68\145\x6e\x74\x69\143\x61\164\145\x5f\165\x73\x65\162\x6e\x61\x6d\145\137\160\x61\163\163\x77\x6f\x72\144", 20, 3);
$vK = new Password(true);
add_filter("\141\x75\164\150\x65\156\164\151\143\x61\x74\x65", array($vK, "\155\x6f\x5f\x6f\141\x75\x74\150\137\167\160\x5f\x6c\157\147\151\x6e"), 20, 3);
vrd:
}
public function mo_oauth_client_restrict_emails($B7, $gL)
{
global $Rg;
$Yr = isset($gL["\x72\145\x73\x74\x72\151\143\x74\x65\x64\x5f\144\x6f\155\141\x69\x6e\163"]) ? $gL["\x72\145\x73\x74\x72\x69\143\x74\x65\144\137\x64\157\155\141\x69\156\x73"] : '';
if (!empty($Yr)) {
goto o07;
}
return;
o07:
$WD = isset($gL["\141\154\154\x6f\167\137\162\145\x73\x74\x72\x69\x63\x74\145\144\137\144\157\x6d\x61\151\156\163"]) ? $gL["\x61\154\x6c\157\x77\137\162\145\163\164\x72\151\x63\x74\145\x64\137\144\x6f\x6d\141\151\x6e\x73"] : '';
if (!empty($WD)) {
goto TLm;
}
$WD = false;
TLm:
$WD = intval($WD);
$Yr = array_map("\x74\162\151\x6d", explode("\54", strtolower($Yr)));
$Fi = strtolower(substr($B7, strpos($B7, "\100") + 1));
$NH = in_array($Fi, $Yr, false);
$NH = $WD ? !$NH : $NH;
$nK = !empty($Yr) && $NH;
if (!$nK) {
goto Xcm;
}
$qh = "\131\157\165\x20\x64\157\x20\x6e\x6f\x74\x20\150\x61\x76\145\x20\162\151\147\x68\x74\163\40\x74\x6f\x20\x61\143\143\x65\x73\163\40\164\x68\x69\163\40\160\x61\x67\145\x2e\x20\x50\x6c\x65\x61\163\x65\40\x63\x6f\x6e\164\141\x63\164\40\x74\150\x65\x20\x61\x64\155\x69\x6e\x69\163\x74\x72\x61\x74\157\162\x2e";
$Rg->handle_error($qh);
wp_die($qh);
Xcm:
}
public function mo_oauth_client_generate_authorization_url($sx, $P8)
{
global $Rg;
$iQ = $Rg->parse_url($sx);
$gL = $Rg->get_app_by_name($P8)->get_app_config();
$U5 = md5(rand());
setcookie("\x6d\157\x5f\157\x61\x75\x74\150\137\156\x6f\156\x63\145", $U5, time() + 120, "\57", null, true, true);
if (isset($gL["\147\162\x61\156\164\137\x74\171\160\145"]) && "\x49\155\160\154\151\143\151\164\40\x47\162\141\x6e\x74" === $gL["\147\162\141\156\x74\x5f\x74\171\160\145"]) {
goto Ih3;
}
if (!(isset($gL["\x67\x72\141\156\x74\137\x74\171\160\x65"]) && "\110\x79\x62\162\x69\x64\40\107\x72\141\x6e\x74" === $gL["\147\x72\141\x6e\x74\137\164\171\x70\145"])) {
goto nic;
}
MO_Oauth_Debug::mo_oauth_log("\107\x72\141\156\164\x3a\x20\x48\171\142\x72\151\x64\x20\107\162\141\156\x74");
$xZ = isset($gL["\x6d\157\137\157\141\165\164\150\x5f\x72\145\x73\x70\x6f\156\x73\x65\x5f\164\171\x70\145"]) && !empty($gL["\x6d\x6f\x5f\x6f\141\165\164\150\137\162\145\163\160\x6f\156\163\145\137\164\171\160\x65"]) ? $gL["\155\x6f\x5f\x6f\x61\x75\164\x68\x5f\162\145\163\160\157\x6e\163\x65\x5f\164\x79\160\145"] : "\x74\157\153\145\x6e\45\x32\x30\151\144\x5f\164\157\153\145\x6e\45\x32\60\x63\157\x64\145";
$iQ["\x71\165\145\162\171"]["\x72\145\x73\160\157\156\x73\x65\137\164\x79\x70\145"] = $xZ;
return $Rg->generate_url($iQ);
nic:
goto ElI;
Ih3:
$iQ["\x71\x75\145\162\171"]["\x6e\157\156\143\x65"] = $U5;
$iQ["\161\x75\x65\x72\171"]["\162\145\x73\160\x6f\x6e\163\x65\137\x74\171\160\x65"] = "\164\x6f\x6b\x65\156";
$xZ = isset($gL["\x6d\x6f\x5f\157\x61\x75\x74\x68\137\x72\145\x73\160\157\x6e\163\145\137\x74\x79\x70\145"]) && !empty($gL["\155\x6f\x5f\x6f\141\x75\x74\150\137\162\145\163\x70\157\x6e\x73\x65\137\164\x79\160\x65"]) ? $gL["\155\157\x5f\157\141\x75\x74\150\x5f\162\145\163\160\157\x6e\x73\145\x5f\x74\x79\x70\x65"] : "\x74\x6f\x6b\145\156";
$iQ["\x71\165\x65\162\171"]["\x72\145\163\x70\157\x6e\163\x65\x5f\x74\171\160\x65"] = $xZ;
return $Rg->generate_url($iQ);
ElI:
return $sx;
}
public function mo_oauth_client_map_roles($CF)
{
$NY = isset($CF["\141\x70\160\137\x63\x6f\156\146\151\147"]) && !empty($CF["\x61\x70\x70\137\x63\x6f\x6e\x66\151\147"]) ? $CF["\141\x70\160\137\x63\157\x6e\x66\x69\x67"] : [];
$if = isset($NY["\147\x72\157\x75\x70\x6e\x61\x6d\145\137\x61\x74\164\162\x69\x62\x75\164\x65"]) && '' !== $NY["\147\x72\157\x75\x70\x6e\141\155\x65\137\141\x74\164\x72\151\x62\165\x74\x65"] ? $NY["\x67\162\x6f\x75\160\x6e\141\155\x65\137\x61\x74\164\162\x69\x62\x75\x74\145"] : false;
$XT = isset($CF["\x6e\145\x77\137\x75\x73\x65\x72"]) && !empty($CF["\156\145\167\137\x75\x73\x65\162"]) ? $CF["\x6e\x65\167\137\165\x73\145\162"] : 0;
global $Rg;
$I3 = false;
if (isset($NY["\x65\156\141\142\x6c\x65\137\x72\157\154\145\137\155\141\x70\160\x69\156\147"])) {
goto I7E;
}
$NY["\145\x6e\141\x62\154\145\137\x72\x6f\x6c\145\x5f\x6d\141\160\160\x69\156\x67"] = true;
$I3 = true;
I7E:
if (isset($NY["\x5f\155\141\160\160\x69\x6e\x67\137\x76\141\x6c\x75\x65\x5f\144\x65\146\x61\x75\x6c\x74"])) {
goto rcq;
}
$NY["\x5f\x6d\141\160\160\x69\x6e\147\x5f\x76\141\154\x75\145\x5f\x64\x65\146\x61\165\154\x74"] = "\x73\165\142\x73\143\x72\151\x62\x65\x72";
$I3 = true;
rcq:
if (!boolval($I3)) {
goto k9C;
}
if (!(isset($NY["\x63\x6c\x69\145\x6e\x74\x5f\x63\162\145\144\163\x5f\x65\x6e\143\162\x70\171\x74\145\144"]) && boolval($NY["\143\154\x69\x65\156\164\x5f\143\x72\x65\x64\163\137\x65\x6e\x63\162\x70\x79\x74\145\144"]))) {
goto nHW;
}
$NY["\x63\x6c\x69\x65\156\164\137\x69\x64"] = $Rg->mooauthencrypt($NY["\143\154\x69\x65\x6e\x74\137\151\x64"]);
$NY["\x63\x6c\x69\x65\x6e\164\137\163\x65\143\162\x65\164"] = $Rg->mooauthencrypt($NY["\x63\x6c\151\x65\156\x74\x5f\x73\145\143\x72\145\x74"]);
nHW:
$Rg->set_app_by_name($CF["\141\160\160\137\156\x61\155\145"], $NY);
k9C:
$this->resource_owner = isset($CF["\162\x65\x73\157\165\162\x63\145\x5f\x6f\x77\x6e\145\x72"]) && !empty($CF["\x72\x65\163\157\165\x72\x63\145\137\x6f\x77\156\x65\162"]) ? $CF["\x72\x65\163\x6f\165\x72\143\145\x5f\157\167\x6e\145\162"] : [];
$this->group_mapping_attr = $this->get_group_mapping_attribute($this->resource_owner, false, $if);
if (!(isset($NY["\x65\x78\x74\x72\x61\143\164\137\145\155\141\x69\154\137\144\x6f\155\x61\x69\x6e\x5f\146\157\x72\137\x72\157\154\145\155\141\160\x70\151\x6e\147"]) && boolval($NY["\x65\170\164\x72\x61\x63\x74\137\x65\155\141\151\x6c\137\x64\x6f\155\141\x69\x6e\x5f\146\157\162\137\162\x6f\154\145\x6d\x61\x70\x70\x69\156\x67"]))) {
goto yPL;
}
if (!is_array($this->group_mapping_attr) && is_email($this->group_mapping_attr)) {
goto H7m;
}
MO_Oauth_Debug::mo_oauth_log("\x45\x6d\141\x69\154\x20\141\144\144\162\145\163\x73\40\x6e\x6f\x74\x20\162\145\x63\145\x69\166\145\x64\40\x69\x6e\40\164\150\x65\x20\x63\x6f\156\x66\151\x67\x75\x72\145\144\x20\x67\162\157\x75\x70\x20\x61\x74\x74\x72\151\142\165\x74\145\40\156\x61\x6d\x65\x20\141\x73\x20\164\x68\145\x20\x6f\x70\x74\151\157\156\x20\x69\x73\x20\145\x6e\x61\142\x6c\145\x64\40\164\x6f\x20\x65\170\164\x72\x61\143\164\40\144\x6f\x6d\x61\x69\156\x20\x77\150\x65\156\x20\x65\155\x61\x69\154\40\x69\x73\x20\x6d\x61\x70\x70\x65\144\x20\x66\157\162\x20\x72\157\154\x65\40\x6d\141\x70\x70\151\156\147\56\40\103\150\145\143\x6b\x20\171\x6f\x75\x72\40\x52\x6f\154\x65\40\115\x61\160\160\x69\156\x67\40\143\x6f\156\146\x69\x67\x75\162\141\x74\151\157\156\56");
$Rg->handle_error("\x45\x6d\x61\x69\x6c\40\x64\x6f\x6d\141\x69\x6e\40\156\157\164\x20\x72\x65\143\x65\x69\166\x65\144\x2e\x20\103\x68\x65\143\153\x20\171\x6f\165\162\40\x3c\163\164\x72\x6f\x6e\x67\76\122\157\x6c\x65\x20\115\141\x70\x70\x69\156\147\74\x2f\x73\164\162\x6f\156\147\76\x20\x63\x6f\x6e\146\151\147\165\162\141\164\151\157\x6e\56");
wp_die("\x45\155\x61\x69\x6c\x20\144\157\x6d\x61\x69\156\40\156\157\164\x20\x72\145\143\x65\x69\x76\145\144\56\x20\103\x68\145\x63\153\40\x79\157\165\x72\x20\74\163\164\x72\x6f\x6e\147\x3e\122\x6f\x6c\x65\40\115\x61\160\160\x69\x6e\147\74\57\x73\x74\x72\157\x6e\147\x3e\x20\143\157\x6e\146\x69\147\x75\x72\x61\164\151\157\x6e\56");
goto is0;
H7m:
$this->group_mapping_attr = substr($this->group_mapping_attr, strpos($this->group_mapping_attr, "\x40") + 1);
is0:
yPL:
MO_Oauth_Debug::mo_oauth_log("\107\162\157\x75\160\x20\115\141\160\x70\x69\156\x67\40\x41\x74\164\x72\x69\142\165\164\145\163\x20\75\x3e\x20" . $if);
$Sa = new MappingHandler(isset($CF["\x75\x73\x65\x72\x5f\x69\x64"]) && is_numeric($CF["\165\x73\145\x72\137\x69\x64"]) ? intval($CF["\x75\163\145\162\137\151\x64"]) : 0, $NY, isset($this->group_mapping_attr) ? $this->group_mapping_attr : '', isset($CF["\x6e\145\167\137\165\163\145\x72"]) ? \boolval($CF["\156\x65\167\x5f\x75\x73\x65\x72"]) : true);
$gL = $CF["\x63\157\156\146\x69\147"];
if (!($XT || (!isset($gL["\x6b\145\x65\x70\137\x65\170\x69\x73\x74\151\x6e\147\137\x75\x73\145\162\x73"]) || 1 !== intval($gL["\x6b\x65\x65\x70\x5f\145\x78\151\163\x74\151\x6e\x67\137\165\163\145\x72\x73"])))) {
goto JGs;
}
$Sa->apply_custom_attribute_mapping(is_array($this->resource_owner) ? $this->resource_owner : []);
JGs:
$Wz = false;
$Wz = apply_filters("\155\x6f\x5f\157\x61\x75\x74\150\137\143\154\151\145\156\x74\x5f\165\x70\144\x61\164\145\x5f\141\x64\x6d\x69\156\x5f\x72\157\154\145", $Wz);
if (!$Wz) {
goto PCA;
}
MO_Oauth_Debug::mo_oauth_log("\101\144\155\151\156\40\x52\157\x6c\x65\x20\x77\x69\154\x6c\x20\x62\x65\x20\x75\x70\x64\141\x74\x65\144");
PCA:
if (!(user_can($CF["\165\x73\x65\x72\137\151\144"], "\x61\x64\x6d\151\156\151\x73\164\162\x61\x74\x6f\x72") && !$Wz)) {
goto MyG;
}
return;
MyG:
$Sa->apply_role_mapping(is_array($this->resource_owner) ? $this->resource_owner : []);
}
public function mo_oauth_client_implicit_fragment_handler()
{
echo "\11\x9\x9\74\x73\143\162\151\160\164\76\xa\11\x9\11\x9\x66\165\156\143\x74\x69\x6f\156\40\x63\x6f\156\166\x65\x72\x74\137\164\157\x5f\165\x72\154\50\157\x62\x6a\x29\40\173\12\11\x9\x9\11\11\x72\x65\x74\165\162\x6e\x20\x4f\x62\152\x65\143\164\xa\x9\11\11\11\x9\x2e\153\145\171\163\50\x6f\142\x6a\51\xa\x9\x9\11\x9\11\x2e\x6d\x61\x70\x28\x6b\40\x3d\x3e\40\140\44\x7b\x65\156\143\157\x64\145\125\122\x49\x43\157\155\160\157\156\145\156\x74\50\153\51\175\x3d\x24\x7b\145\x6e\143\x6f\144\145\125\122\111\x43\x6f\x6d\160\157\x6e\145\156\164\x28\x6f\142\152\x5b\153\x5d\x29\x7d\140\51\12\11\11\x9\11\11\56\152\x6f\151\156\x28\x27\46\x27\x29\x3b\xa\x9\x9\11\11\175\12\xa\x9\11\x9\11\146\x75\x6e\143\164\x69\x6f\x6e\x20\160\141\163\163\x5f\x74\157\x5f\x62\x61\143\x6b\145\x6e\144\x28\x29\40\173\xa\11\11\11\x9\x9\151\x66\x28\x77\151\156\x64\x6f\x77\x2e\154\157\143\141\164\151\x6f\156\56\150\x61\163\x68\x29\x20\173\12\x9\11\x9\11\11\x9\x76\x61\x72\x20\150\141\x73\x68\40\x3d\x20\167\151\x6e\x64\157\x77\x2e\x6c\157\x63\x61\164\x69\157\156\56\x68\x61\163\x68\73\xa\11\11\x9\x9\x9\11\166\x61\x72\40\145\154\x65\x6d\x65\156\x74\163\40\75\40\173\175\73\xa\x9\x9\11\x9\11\x9\x68\141\x73\x68\56\163\x70\154\151\164\50\x22\x23\42\x29\133\x31\135\x2e\163\x70\154\x69\164\x28\x22\46\x22\51\x2e\x66\157\162\105\141\143\150\50\145\x6c\x65\x6d\x65\156\x74\x20\75\x3e\40\173\xa\x9\x9\x9\11\11\11\11\x76\141\162\x20\166\141\x72\163\x20\75\x20\x65\154\145\155\145\156\164\x2e\x73\x70\x6c\151\x74\50\42\x3d\x22\x29\x3b\12\x9\x9\x9\x9\11\x9\x9\145\154\x65\155\x65\x6e\x74\x73\133\166\141\x72\163\133\x30\135\x5d\x20\75\x20\x76\x61\162\163\x5b\x31\x5d\x3b\xa\x9\x9\x9\x9\x9\x9\x7d\x29\x3b\12\11\x9\11\11\x9\11\x69\x66\50\50\x22\141\x63\x63\145\x73\163\137\164\x6f\153\x65\x6e\x22\40\x69\156\x20\145\x6c\x65\155\145\156\x74\163\51\x20\x7c\174\x20\x28\x22\x69\144\137\164\157\x6b\145\156\42\40\x69\156\40\x65\x6c\x65\155\145\156\x74\163\x29\40\x7c\174\40\x28\x22\164\x6f\153\145\156\x22\x20\x69\x6e\x20\145\x6c\145\x6d\x65\x6e\x74\163\51\x29\40\x7b\12\x9\11\x9\x9\11\11\11\x69\x66\50\x77\151\x6e\x64\x6f\167\56\154\x6f\143\x61\164\151\x6f\156\x2e\x68\x72\145\x66\x2e\151\156\x64\x65\x78\117\x66\50\x22\77\x22\x29\40\x21\x3d\75\x20\x2d\61\51\x20\173\12\x9\11\11\x9\x9\x9\x9\11\x77\x69\x6e\x64\157\x77\56\154\157\x63\x61\164\151\x6f\x6e\40\x3d\x20\50\x77\151\156\x64\157\167\x2e\154\157\x63\x61\x74\x69\x6f\x6e\x2e\x68\x72\145\146\56\x73\x70\154\151\164\50\42\x3f\x22\51\x5b\x30\135\x20\x2b\40\167\x69\156\x64\x6f\167\x2e\x6c\157\143\141\x74\x69\x6f\x6e\x2e\150\x61\163\x68\x29\56\163\160\154\151\164\x28\x27\x23\x27\51\133\x30\x5d\x20\53\40\x22\x3f\42\40\53\40\x63\x6f\x6e\x76\145\x72\x74\x5f\164\157\x5f\x75\162\154\x28\x65\154\145\x6d\x65\x6e\x74\x73\x29\x3b\12\11\x9\11\x9\x9\11\x9\x7d\x20\x65\154\x73\145\x20\x7b\xa\11\x9\x9\x9\11\x9\x9\11\x77\151\x6e\x64\x6f\167\56\x6c\157\x63\x61\x74\x69\157\156\x20\x3d\x20\x77\x69\x6e\144\x6f\167\56\x6c\157\143\x61\164\x69\x6f\x6e\56\x68\x72\145\146\x2e\x73\x70\154\x69\x74\50\x27\x23\x27\x29\x5b\x30\135\40\53\x20\x22\x3f\x22\x20\53\x20\x63\x6f\x6e\x76\x65\162\164\137\x74\157\137\x75\162\154\50\x65\x6c\x65\155\x65\x6e\x74\163\51\x3b\12\x9\11\11\x9\11\11\x9\x7d\xa\x9\x9\x9\11\x9\11\x7d\12\x9\11\x9\11\11\175\12\x9\11\11\x9\175\xa\xa\x9\11\x9\x9\160\x61\163\x73\137\x74\x6f\x5f\142\141\x63\153\x65\x6e\144\50\x29\x3b\xa\11\11\x9\x3c\x2f\163\143\x72\x69\160\x74\76\12\12\11\x9";
}
private function check_state($QA)
{
global $Rg;
$OC = str_replace("\x25\63\x64", "\75", urldecode($QA->get_query_param("\163\x74\x61\x74\x65")));
if (empty($OC) && isset($_COOKIE["\163\x74\141\164\145\x5f\x70\141\162\141\x6d"])) {
goto GIj;
}
if (isset($_GET["\x73\x74\141\x74\x65"]) && !empty($_GET["\163\x74\x61\x74\x65"])) {
goto ej8;
}
goto GS8;
GIj:
$OC = $_COOKIE["\163\164\x61\x74\145\137\160\x61\x72\x61\x6d"];
goto GS8;
ej8:
$OC = wp_unslash($_GET["\163\x74\141\164\145"]);
GS8:
$c8 = new StorageManager($OC);
$vR = $c8->get_value("\x61\x70\160\x6e\141\x6d\145");
$NY = $Rg->get_app_by_name($vR)->get_app_config();
$Xq = $NY["\141\160\160\111\x64"];
$s2 = $Rg->get_app_by_name($Xq);
if (!is_wp_error($c8)) {
goto IU0;
}
$Rg->handle_error($c8->get_error_message());
wp_die(wp_kses($c8->get_error_message(), \mo_oauth_get_valid_html()));
IU0:
$Ll = $c8->get_value("\x75\x69\x64");
if (!($Ll && MO_UID === $Ll)) {
goto ILh;
}
$this->appname = $c8->get_value("\x61\160\160\x6e\141\x6d\x65");
return $c8;
ILh:
return false;
}
public function mo_oauth_login_validate()
{
if (isset($_REQUEST["\155\x6f\137\x6c\157\147\x69\156\137\160\x6f\x70\x75\160"]) && 1 == sanitize_text_field($_REQUEST["\x6d\x6f\x5f\x6c\x6f\x67\151\156\x5f\160\x6f\x70\x75\160"])) {
goto Ppd;
}
parent::mo_oauth_login_validate();
global $Rg;
if (!(isset($_REQUEST["\x74\157\x6b\x65\156"]) && !empty($_REQUEST["\164\157\x6b\145\156"]) || isset($_REQUEST["\151\x64\137\164\157\x6b\145\156"]) && !empty($_REQUEST["\151\x64\137\x74\x6f\153\x65\156"]))) {
goto qZS;
}
if (!(isset($_REQUEST["\x74\x6f\x6b\x65\156"]) && !empty($_REQUEST["\164\x6f\153\145\156"]))) {
goto LVT;
}
$zM = $Rg->is_valid_jwt(urldecode($_REQUEST["\x74\157\x6b\145\x6e"]));
if ($zM) {
goto tIi;
}
return;
tIi:
LVT:
if (!(isset($_REQUEST["\156\157\x6e\143\x65"]) && (isset($_COOKIE["\155\x6f\x5f\x6f\141\x75\164\150\137\x6e\157\156\x63\145"]) && $_COOKIE["\x6d\x6f\137\157\141\x75\164\x68\x5f\156\157\156\x63\145"] != $_REQUEST["\x6e\x6f\156\x63\145"]))) {
goto ydg;
}
$Rg->handle_error("\116\157\x6e\x63\145\x20\166\145\x72\151\x66\x69\x63\x61\164\151\x6f\156\x20\151\x73\40\x66\x61\x69\x6c\145\144\56\x20\120\x6c\x65\141\x73\145\40\143\157\156\164\x61\143\x74\40\164\157\x20\171\x6f\165\x72\x20\141\x64\155\151\x6e\x69\x73\x74\x72\x61\164\x6f\162\x2e");
wp_die("\x4e\x6f\x6e\x63\x65\40\x76\x65\162\x69\x66\x69\143\141\164\151\x6f\x6e\x20\151\x73\x20\146\141\x69\x6c\145\x64\56\40\x50\x6c\145\x61\163\145\x20\143\157\x6e\164\x61\143\x74\x20\164\157\x20\x79\x6f\x75\x72\40\141\144\155\151\156\x69\163\x74\162\141\x74\157\x72\56");
exit;
ydg:
$QA = new Implicit(isset($_SERVER["\x51\125\x45\122\131\137\123\124\122\111\116\x47"]) ? $_SERVER["\x51\125\105\122\131\137\x53\x54\x52\x49\x4e\107"] : '');
if (!is_wp_error($QA)) {
goto g3V;
}
$Rg->handle_error($QA->get_error_message());
wp_die(wp_kses($QA->get_error_message(), \mo_oauth_get_valid_html()));
MO_Oauth_Debug::mo_oauth_log("\x50\154\145\x61\163\x65\40\164\x72\x79\40\114\157\147\147\151\156\x67\40\x69\156\40\x61\147\141\151\x6e\56");
exit("\x50\x6c\145\141\x73\x65\40\x74\x72\x79\x20\x4c\157\147\147\151\x6e\x67\40\x69\x6e\x20\141\147\141\151\x6e\56");
g3V:
$lb = $QA->get_jwt_from_query_param();
if (!is_wp_error($lb)) {
goto TAn;
}
$Rg->handle_error($lb->get_error_message());
MO_Oauth_Debug::mo_oauth_log($lb->get_error_message());
wp_die(wp_kses($lb->get_error_message(), \mo_oauth_get_valid_html()));
TAn:
MO_Oauth_Debug::mo_oauth_log("\x4a\x57\x54\40\124\x6f\x6b\145\156\x20\x75\x73\145\144\x20\x66\x6f\x72\x20\157\142\x74\141\151\156\151\156\x67\40\x72\145\163\157\x75\x72\x63\x65\x20\x6f\167\156\x65\162\x20\x3d\76\x20");
MO_Oauth_Debug::mo_oauth_log($lb);
$c8 = $this->check_state($QA);
if ($c8) {
goto Q8Q;
}
$QK = "\123\164\141\x74\x65\40\120\141\x72\141\155\145\x74\145\162\40\x64\151\x64\x20\156\x6f\x74\x20\x76\145\x72\x69\x66\x79\x2e\40\120\x6c\145\x61\163\145\x20\x54\162\171\x20\x4c\x6f\x67\x67\x69\x6e\147\x20\x69\156\x20\141\x67\141\x69\x6e\x2e";
$Rg->handle_error($QK);
MO_Oauth_Debug::mo_oauth_log("\123\164\x61\164\145\x20\120\141\x72\x61\155\145\164\x65\162\40\144\x69\144\x20\x6e\x6f\x74\x20\166\145\x72\151\x66\171\x2e\40\120\x6c\145\x61\163\145\x20\x54\x72\x79\x20\114\x6f\147\147\151\156\147\x20\x69\x6e\x20\141\x67\x61\151\x6e\61\56");
wp_die($QK);
Q8Q:
$NY = $Rg->get_app_by_name($this->app_name);
$NY = $NY ? $NY->get_app_config() : false;
$so = $this->handle_jwt($lb);
MO_Oauth_Debug::mo_oauth_log("\122\x65\163\x6f\165\162\143\145\40\117\167\x6e\x65\x72\x20\x3d\76\x20");
MO_Oauth_Debug::mo_oauth_log($so);
if (!is_wp_error($so)) {
goto L1o;
}
$Rg->handle_error($so->get_error_message());
wp_die(wp_kses($so->get_error_message(), \mo_oauth_get_valid_html()));
L1o:
if ($NY) {
goto OWV;
}
$Q8 = "\123\x74\141\x74\145\x20\x50\x61\x72\x61\x6d\x65\164\145\x72\x20\144\151\x64\40\x6e\x6f\x74\x20\166\x65\162\x69\x66\171\x2e\40\x50\154\145\x61\163\145\40\124\x72\171\40\x4c\x6f\x67\147\x69\x6e\x67\40\151\x6e\40\x61\147\x61\x69\156\62\56";
$Rg->handle_error($Q8);
MO_Oauth_Debug::mo_oauth_log("\x53\x74\141\x74\x65\40\120\x61\x72\141\x6d\x65\x74\x65\162\40\x64\151\x64\40\156\x6f\164\x20\166\x65\162\x69\146\171\56\40\120\154\145\x61\x73\x65\40\124\162\171\x20\x4c\x6f\x67\x67\151\156\x67\40\x69\156\x20\x61\147\x61\x69\x6e\56");
wp_die($Q8);
OWV:
if ($so) {
goto ItC;
}
$hC = "\112\127\124\x20\123\151\147\x6e\141\x74\x75\162\x65\40\144\151\144\40\156\157\164\40\x76\145\162\151\146\171\56\40\120\x6c\x65\x61\x73\145\40\124\x72\171\40\x4c\x6f\147\147\x69\156\147\x20\151\156\40\x61\147\x61\151\156\56";
$Rg->handle_error($hC);
MO_Oauth_Debug::mo_oauth_log("\x4a\x57\124\40\x53\x69\147\x6e\x61\x74\165\x72\x65\40\x64\151\144\40\x6e\157\x74\x20\x76\145\x72\151\x66\171\56\40\120\x6c\x65\141\x73\x65\40\124\x72\x79\40\114\157\x67\x67\151\156\x67\x20\x69\156\40\141\x67\141\x69\x6e\56");
wp_die($hC);
ItC:
$CV = $c8->get_value("\x74\x65\163\x74\137\143\157\156\146\x69\147");
$this->resource_owner = $so;
$this->handle_group_details($QA->get_query_param("\x61\143\143\145\163\x73\x5f\164\x6f\x6b\145\156"), isset($NY["\147\162\157\165\160\x64\145\x74\141\x69\154\x73\x75\x72\x6c"]) ? $NY["\x67\162\x6f\x75\x70\144\145\164\141\151\x6c\163\165\x72\x6c"] : '', isset($NY["\147\x72\x6f\x75\160\156\141\155\145\137\x61\x74\164\x72\151\142\x75\x74\145"]) ? $NY["\x67\162\x6f\165\x70\156\x61\155\x65\x5f\x61\164\164\162\x69\x62\x75\x74\x65"] : '', $CV);
$n_ = [];
$vc = $this->dropdownattrmapping('', $so, $n_);
$Rg->mo_oauth_client_update_option("\155\157\x5f\157\141\x75\x74\150\x5f\141\164\x74\162\x5f\156\x61\155\x65\x5f\154\x69\x73\x74" . $NY["\x61\x70\x70\x49\144"], $vc);
if (!($CV && '' !== $CV)) {
goto xKu;
}
$this->render_test_config_output($so);
exit;
xKu:
MO_Oauth_Debug::mo_oauth_log("\102\145\x66\x6f\x72\145\40\150\x61\156\x64\x6c\145\40\163\x73\x6f\61");
$this->handle_sso($this->app_name, $NY, $so, $c8->get_state(), $QA->get_query_param());
qZS:
if (!(isset($_REQUEST["\x68\165\x62\154\x65\x74"]) || isset($_REQUEST["\x70\157\162\164\x61\154\x5f\x64\157\x6d\x61\151\156"]))) {
goto bSz;
}
return;
bSz:
if (!(isset($_REQUEST["\x61\x63\143\x65\163\x73\x5f\164\x6f\x6b\145\156"]) && '' !== $_REQUEST["\x61\143\x63\x65\x73\x73\x5f\164\x6f\x6b\x65\156"])) {
goto Ieq;
}
do_action("\x6d\x6f\137\x6f\x61\165\x74\x68\137\143\150\x65\x63\153\x5f\143\165\163\x74\157\x6d\x5f\141\x63\x63\x65\x73\163\x5f\164\x6f\153\x65\x6e", $_REQUEST);
$QA = new Implicit(isset($_SERVER["\121\125\105\x52\131\x5f\123\x54\x52\x49\x4e\107"]) ? $_SERVER["\x51\125\x45\x52\x59\x5f\x53\124\122\x49\x4e\107"] : '');
$c8 = $this->check_state($QA);
if ($c8) {
goto MLL;
}
$QK = "\x53\x74\141\x74\x65\x20\x50\x61\x72\141\155\x65\164\x65\x72\x20\x64\x69\144\40\x6e\x6f\x74\x20\166\145\x72\x69\x66\x79\x2e\x20\120\x6c\145\x61\163\x65\40\x54\162\171\40\114\157\x67\x67\x69\x6e\x67\40\151\156\x20\141\x67\x61\x69\x6e\56";
$Rg->handle_error($QK);
MO_Oauth_Debug::mo_oauth_log("\123\x74\141\x74\x65\x20\x50\141\162\x61\x6d\145\164\x65\x72\40\x64\151\x64\x20\x6e\157\x74\40\166\x65\162\151\146\171\56\x20\120\154\145\x61\x73\x65\40\124\162\171\x20\x4c\157\x67\x67\151\x6e\147\40\x69\x6e\40\x61\147\x61\151\x6e\x32\x2e");
wp_die($QK);
MLL:
$NY = $Rg->get_app_by_name($c8->get_value("\141\x70\x70\x6e\141\155\145"));
$NY = $NY->get_app_config();
$so = [];
if (!(isset($NY["\x72\x65\163\x6f\165\x72\143\x65\157\x77\x6e\x65\x72\144\x65\164\141\151\154\x73\x75\162\154"]) && !empty($NY["\x72\x65\x73\157\165\x72\x63\x65\157\x77\x6e\x65\x72\144\x65\x74\141\x69\154\x73\165\162\154"]))) {
goto p_7;
}
$so = $this->oauth_handler->get_resource_owner($NY["\162\145\163\x6f\165\162\x63\x65\157\167\156\145\162\x64\x65\164\141\151\154\x73\165\x72\x6c"], $QA->get_query_param("\x61\x63\x63\145\163\x73\x5f\164\x6f\x6b\145\156"));
p_7:
MO_Oauth_Debug::mo_oauth_log("\x41\x63\x63\145\163\163\x20\x54\157\x6b\145\156\x20\x3d\x3e\40");
MO_Oauth_Debug::mo_oauth_log($QA->get_query_param("\x61\143\x63\x65\163\x73\137\x74\x6f\153\145\156"));
$kb = [];
if (!$Rg->is_valid_jwt($QA->get_query_param("\141\143\143\x65\163\163\137\164\x6f\x6b\x65\156"))) {
goto sWk;
}
$lb = $QA->get_jwt_from_query_param();
$kb = $this->handle_jwt($lb);
sWk:
if (empty($kb)) {
goto OJC;
}
$so = array_merge($so, $kb);
OJC:
if (!(empty($so) && !$Rg->is_valid_jwt($QA->get_query_param("\141\143\143\145\x73\163\x5f\x74\157\x6b\145\x6e")))) {
goto IKZ;
}
$Rg->handle_error("\x49\x6e\166\141\x6c\151\x64\x20\122\x65\163\x70\x6f\156\x73\x65\40\x52\x65\143\x65\151\166\x65\144\x2e");
MO_Oauth_Debug::mo_oauth_log("\x49\156\166\x61\x6c\x69\144\40\122\x65\163\x70\x6f\x6e\x73\145\x20\x52\x65\143\145\x69\x76\145\x64");
wp_die("\111\156\x76\141\x6c\x69\144\40\x52\145\163\x70\x6f\x6e\163\x65\x20\122\145\x63\x65\151\x76\x65\x64\56");
exit;
IKZ:
$this->resource_owner = $so;
MO_Oauth_Debug::mo_oauth_log("\x52\145\163\x6f\x75\x72\143\145\40\x4f\x77\x6e\145\162\x20\x3d\76\40");
MO_Oauth_Debug::mo_oauth_log($this->resource_owner);
$CV = $c8->get_value("\x74\x65\x73\164\137\143\x6f\x6e\146\x69\147");
$this->handle_group_details($QA->get_query_param("\141\x63\143\x65\x73\x73\137\x74\157\x6b\145\x6e"), isset($NY["\147\x72\x6f\165\x70\144\145\164\x61\x69\x6c\x73\165\162\x6c"]) ? $NY["\x67\162\x6f\x75\x70\x64\x65\x74\141\x69\154\163\x75\x72\154"] : '', isset($NY["\x67\x72\157\x75\x70\156\141\x6d\x65\x5f\x61\164\x74\x72\151\x62\165\164\145"]) ? $NY["\147\x72\157\165\160\x6e\x61\x6d\145\x5f\x61\164\x74\x72\151\142\165\x74\145"] : '', $CV);
$n_ = [];
$vc = $this->dropdownattrmapping('', $so, $n_);
$Rg->mo_oauth_client_update_option("\155\x6f\x5f\157\141\x75\x74\150\137\141\x74\164\x72\x5f\156\141\x6d\x65\137\x6c\x69\x73\x74" . $NY["\141\160\160\111\x64"], $vc);
if (!($CV && '' !== $CV)) {
goto NHU;
}
$this->render_test_config_output($so);
exit;
NHU:
$OC = str_replace("\x25\63\104", "\75", rawurldecode($QA->get_query_param("\163\x74\x61\x74\145")));
$this->handle_sso($this->app_name, $NY, $so, $OC, $QA->get_query_param());
Ieq:
if (!(isset($_REQUEST["\x6c\157\x67\151\x6e"]) && "\160\167\x64\x67\x72\x6e\x74\146\x72\155" === $_REQUEST["\154\157\x67\x69\x6e"])) {
goto PfQ;
}
$vK = new Password();
$MO = isset($_REQUEST["\143\141\154\x6c\145\162"]) && !empty($_REQUEST["\x63\x61\154\154\x65\162"]) ? $_REQUEST["\143\x61\x6c\154\145\x72"] : false;
$SZ = isset($_REQUEST["\x74\157\x6f\154"]) && !empty($_REQUEST["\x74\x6f\157\154"]) ? $_REQUEST["\164\x6f\x6f\154"] : false;
$P8 = isset($_REQUEST["\x61\160\160\137\156\141\155\145"]) && !empty($_REQUEST["\x61\160\160\x5f\x6e\141\x6d\145"]) ? $_REQUEST["\x61\160\x70\137\156\x61\155\145"] : '';
if (!($P8 == '')) {
goto hB9;
}
$NE = "\x4e\x6f\x20\x73\165\143\150\x20\141\x70\x70\x20\x66\157\165\156\x64\x20\143\x6f\156\x66\x69\147\165\162\145\144\x2e\40\x50\x6c\145\x61\163\145\40\143\150\x65\143\153\40\x69\146\x20\171\x6f\165\x20\141\x72\145\x20\x73\x65\x6e\144\151\156\x67\40\x74\x68\x65\40\x63\x6f\x72\x72\x65\143\x74\40\141\160\x70\154\151\x63\x61\164\x69\157\x6e\x20\x6e\x61\155\x65";
$Rg->handle_error($NE);
wp_die(wp_kses($NE, \mo_oauth_get_valid_html()));
exit;
hB9:
$Z3 = $Rg->mo_oauth_client_get_option("\x6d\x6f\x5f\x6f\141\165\x74\x68\137\141\x70\x70\x73\x5f\154\151\x73\164");
if (is_array($Z3) && isset($Z3[$P8])) {
goto OfN;
}
$NE = "\x4e\x6f\x20\x73\x75\x63\150\x20\x61\160\160\x20\146\x6f\165\x6e\x64\x20\x63\x6f\156\146\x69\x67\x75\162\x65\144\x2e\x20\120\154\x65\141\x73\x65\x20\143\x68\145\143\153\x20\x69\146\40\x79\x6f\x75\x20\141\x72\x65\x20\x73\x65\156\x64\151\156\147\x20\x74\x68\x65\40\x63\157\x72\x72\x65\143\164\x20\141\x70\160\137\x6e\141\x6d\x65";
$Rg->handle_error($NE);
wp_die(wp_kses($NE, \mo_oauth_get_valid_html()));
exit;
OfN:
$ZB = isset($_REQUEST["\154\157\143\141\x74\x69\x6f\x6e"]) && !empty($_REQUEST["\x6c\157\143\x61\x74\x69\157\x6e"]) ? $_REQUEST["\154\157\143\x61\164\151\157\156"] : site_url();
$eO = isset($_REQUEST["\x74\x65\163\164"]) && !empty($_REQUEST["\x74\145\x73\164"]);
if (!(!$MO || !$SZ || !$P8)) {
goto BPH;
}
$Rg->redirect_user(urldecode($ZB));
BPH:
do_action("\155\157\137\x6f\141\x75\164\x68\x5f\143\165\163\x74\x6f\155\137\163\x73\x6f", $MO, $SZ, $P8, $ZB, $eO);
$vK->behave($MO, $SZ, $P8, $ZB, $eO);
PfQ:
goto l4t;
Ppd:
echo "\11\11\11\74\x73\143\162\x69\160\x74\40\164\x79\x70\x65\75\42\x74\x65\170\164\x2f\152\141\x76\141\x73\143\162\151\160\x74\x22\76\12\11\x9\x9\x76\x61\x72\x20\142\x61\163\145\x5f\165\162\154\x20\75\x20\x22";
echo site_url();
echo "\x22\73\xa\x9\x9\11\166\x61\x72\x20\x61\160\x70\x5f\156\141\155\145\40\75\x20\42";
echo sanitize_text_field($_REQUEST["\141\x70\x70\137\156\x61\155\145"]);
echo "\42\x3b\xa\x9\11\x9\11\x76\x61\x72\40\155\171\x57\x69\156\x64\157\167\x20\x3d\x20\x77\151\x6e\144\x6f\167\x2e\157\x70\x65\x6e\x28\x20\x62\141\x73\145\x5f\x75\162\x6c\40\53\40\47\57\77\157\160\164\151\157\156\x3d\157\141\x75\x74\150\162\x65\144\151\x72\145\x63\x74\x26\141\x70\160\x5f\x6e\141\155\145\75\47\40\x2b\x20\141\160\x70\137\x6e\x61\x6d\145\x2c\x20\47\47\x2c\40\47\167\x69\x64\164\150\x3d\x35\60\x30\54\x68\145\151\147\x68\x74\75\x35\x30\x30\47\x29\73\12\11\11\11\11\74\57\x73\x63\162\x69\x70\164\x3e\12\x9\x9\11\x9";
l4t:
}
public function handle_group_details($sI = '', $xi = '', $xC = '', $CV = false)
{
$Ac = [];
if (!('' === $sI || '' === $xC)) {
goto Hck;
}
return;
Hck:
if (!('' !== $xi)) {
goto rYW;
}
$Ac = $this->oauth_handler->get_resource_owner($xi, $sI);
if (!(isset($_COOKIE["\x6d\157\x5f\157\x61\165\164\150\137\x74\x65\163\164"]) && $_COOKIE["\155\x6f\137\x6f\141\165\x74\150\137\x74\145\163\164"])) {
goto xFM;
}
if (!(is_array($Ac) && !empty($Ac))) {
goto B2g;
}
$this->render_test_config_output($Ac, true);
B2g:
return;
xFM:
rYW:
$if = $this->get_group_mapping_attribute($this->resource_owner, $Ac, $xC);
$this->group_mapping_attr = '' !== $if ? false : $if;
}
public function get_group_mapping_attribute($so = array(), $Ac = array(), $xC = '')
{
global $Rg;
$RV = '';
if (!('' === $xC)) {
goto tk1;
}
return '';
tk1:
if (isset($Ac) && !empty($Ac)) {
goto Y69;
}
if (isset($so) && !empty($so)) {
goto YY7;
}
goto i0T;
Y69:
$RV = $Rg->getnestedattribute($Ac, $xC);
goto i0T;
YY7:
$RV = $Rg->getnestedattribute($so, $xC);
i0T:
if (!($RV === 0 || $RV === "\60")) {
goto SHd;
}
return $RV;
SHd:
return !empty($RV) ? $RV : '';
}
public function handle_jwt($lb)
{
global $Rg;
$s2 = $Rg->get_app_by_name($this->app_name);
$Xb = $s2->get_app_config("\152\x77\164\137\x73\x75\x70\160\x6f\x72\164");
if ($Xb) {
goto GcH;
}
return $lb->get_decoded_payload();
GcH:
$gK = $s2->get_app_config("\152\x77\164\137\x61\x6c\147\157");
if ($lb->check_algo($gK)) {
goto E7k;
}
return new \WP_Error("\151\x6e\x76\x61\154\151\144\x5f\163\151\147\x6e", __("\x4a\127\124\40\x53\x69\147\156\x69\156\147\40\141\154\x67\x6f\x72\151\164\150\x6d\x20\x69\163\40\156\157\164\40\x61\x6c\154\157\x77\x65\144\40\157\x72\x20\165\156\x73\165\x70\160\x6f\162\x74\145\144\x2e"));
E7k:
$WG = "\122\123\101" === $gK ? $s2->get_app_config("\x78\65\x30\71\x5f\143\x65\x72\x74") : $s2->get_app_config("\143\154\151\145\x6e\x74\137\x73\x65\x63\162\x65\x74");
$Nc = $s2->get_app_config("\x6a\167\x6b\163\x75\x72\154");
$pZ = $Nc ? $lb->verify_from_jwks($Nc) : $lb->verify($WG);
return !$pZ ? $pZ : $lb->get_decoded_payload();
}
public function get_resource_owner_from_app($Rp, $s2)
{
global $Rg;
$this->app_name = $s2;
$lb = new JWTUtils($Rp);
if (!is_wp_error($lb)) {
goto exi;
}
$Rg->handle_error($lb->get_error_message());
wp_die($lb);
exi:
$so = $this->handle_jwt($lb);
if (!is_wp_error($so)) {
goto Lxc;
}
$Rg->handle_error($so->get_error_message());
wp_die($so);
Lxc:
if (!(false === $so)) {
goto kZQ;
}
$qh = "\x46\141\x69\x6c\145\144\40\x74\157\40\166\145\162\151\146\171\40\x4a\127\124\40\x54\x6f\153\145\x6e\56\40\x50\x6c\x65\x61\163\x65\40\143\x68\x65\x63\153\x20\x79\157\165\x72\40\x63\157\x6e\146\x69\x67\x75\x72\141\x74\x69\157\x6e\x20\157\x72\x20\143\x6f\156\x74\141\x63\164\x20\171\157\x75\x72\x20\101\x64\x6d\x69\x6e\151\x73\x74\162\141\x74\157\x72\56";
$Rg->handle_error($qh);
MO_Oauth_Debug::mo_oauth_log("\106\x61\x69\154\145\x64\40\164\x6f\x20\166\x65\x72\151\146\171\40\x4a\x57\x54\40\124\157\x6b\x65\x6e\x2e\40\x50\x6c\145\141\163\x65\40\143\150\x65\x63\x6b\40\x79\157\x75\x72\40\x63\x6f\x6e\x66\151\147\165\x72\141\x74\x69\157\156\x20\x6f\x72\x20\x63\157\156\x74\x61\143\x74\40\171\x6f\x75\162\40\101\144\155\x69\156\151\x73\x74\x72\x61\164\157\162\56");
wp_die($qh);
kZQ:
return $so;
}
}
Function Calls
| None |
Stats
| MD5 | eb2547a0264e9ff2968040bf6af7e6f2 |
| Eval Count | 0 |
| Decode Time | 106 ms |