Version Notes
Use OpenID Connect to login by leveraging the oxd client service demon.
Download this release
Release Info
| Developer | Volodya |
| Extension | Magento_gluu_SSO |
| Version | 2.4.3 |
| Comparing to | |
| See all releases | |
Code changes from version 2.4.2.0 to 2.4.3
- app/code/community/GluuOxd/Openid/Block/GluuOxOpenidConfig.php +4 -239
- app/code/community/GluuOxd/Openid/Helper/RegisterSite.php +1 -1
- app/code/community/GluuOxd/Openid/Helper/UpdateSiteRegistration.php +304 -0
- app/code/community/GluuOxd/Openid/controllers/Adminhtml/IndexController.php +32 -51
- app/code/community/GluuOxd/Openid/etc/GluuOxd_module.xml +83 -0
- app/code/community/GluuOxd/Openid/etc/config.xml +1 -1
- app/design/adminhtml/default/default/layout/GluuOxd_Openid.xml +2 -4
- app/design/adminhtml/default/default/template/gluuoxd_openid/gluuOxOpenidConfig.phtml +9 -6
- app/design/adminhtml/default/default/template/gluuoxd_openid/login.phtml +103 -187
- app/design/frontend/base/default/template/gluuoxd_openid/homepage.phtml +1 -1
- app/etc/modules/GluuOxd_Openid.xml +22 -0
- package.xml +3 -3
app/code/community/GluuOxd/Openid/Block/GluuOxOpenidConfig.php
CHANGED
|
@@ -10,7 +10,6 @@ class GluuOxd_Openid_Block_GluuOxOpenidConfig extends Mage_Core_Block_Template{
|
|
| 10 |
private $getUserInfo = "GluuOxd_Openid/getUserInfo";
|
| 11 |
private $logout = "GluuOxd_Openid/logout";
|
| 12 |
|
| 13 |
-
|
| 14 |
/**
|
| 15 |
* Administrator logout action
|
| 16 |
*/
|
|
@@ -29,31 +28,12 @@ class GluuOxd_Openid_Block_GluuOxOpenidConfig extends Mage_Core_Block_Template{
|
|
| 29 |
$logout->request();
|
| 30 |
header("Location: ".$logout->getResponseObject()->data->uri);
|
| 31 |
exit;
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
}
|
| 35 |
-
/**
|
| 36 |
-
* Administrator logout action
|
| 37 |
-
*/
|
| 38 |
-
public function logout_validation_admin()
|
| 39 |
-
{
|
| 40 |
|
| 41 |
-
|
| 42 |
-
if($_SESSION['state']){
|
| 43 |
-
$config_option = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config_admin' ));
|
| 44 |
-
$oxd_id = Mage::getStoreConfig ( 'gluu/oxd/oxd_id_admin' );
|
| 45 |
-
$logout = $this->getLogout();
|
| 46 |
-
$logout->setRequestOxdId($oxd_id);
|
| 47 |
-
$logout->setRequestIdToken($_SESSION['user_oxd_id_token_admin']);
|
| 48 |
-
$logout->setRequestPostLogoutRedirectUri($config_option['logout_redirect_uri']);
|
| 49 |
-
$logout->setRequestSessionState($_SESSION['session_state_admin']);
|
| 50 |
-
$logout->setRequestState($_SESSION['state_admin']);
|
| 51 |
-
$logout->request();
|
| 52 |
-
header("Location: ".$logout->getResponseObject()->data->uri);
|
| 53 |
-
exit;
|
| 54 |
}
|
| 55 |
|
| 56 |
}
|
|
|
|
| 57 |
/**
|
| 58 |
* @return string
|
| 59 |
*/
|
|
@@ -256,223 +236,7 @@ class GluuOxd_Openid_Block_GluuOxOpenidConfig extends Mage_Core_Block_Template{
|
|
| 256 |
public function getOpenIdAdminUrl(){
|
| 257 |
return Mage::helper("adminhtml")->getUrl("*/index/index");
|
| 258 |
}
|
| 259 |
-
function _getRequestUri($request = null)
|
| 260 |
-
{
|
| 261 |
-
if (Mage::getSingleton('adminhtml/url')->useSecretKey()) {
|
| 262 |
-
return Mage::getSingleton('adminhtml/url')->getUrl('*/*/*', array('_current' => true));
|
| 263 |
-
} elseif ($request) {
|
| 264 |
-
return $request->getRequestUri();
|
| 265 |
-
} else {
|
| 266 |
-
return null;
|
| 267 |
-
}
|
| 268 |
-
}
|
| 269 |
-
/**
|
| 270 |
-
* getting admin login page validateing
|
| 271 |
-
* return @string
|
| 272 |
-
*/
|
| 273 |
-
public function gluuoxd_openid_login_admin(){
|
| 274 |
-
|
| 275 |
-
if(isset( $_REQUEST['option'] ) and strpos( $_REQUEST['option'], 'getOxdSocialLogin' ) !== false ) {
|
| 276 |
-
|
| 277 |
-
$config_option = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config_admin' ));
|
| 278 |
-
$oxd_id = Mage::getStoreConfig ( 'gluu/oxd/oxd_id_admin' );
|
| 279 |
-
$get_tokens_by_code = $this->getGetTokensByCode();
|
| 280 |
-
$get_tokens_by_code->setRequestOxdId($oxd_id);
|
| 281 |
-
$get_tokens_by_code->setRequestCode($_REQUEST['code']);
|
| 282 |
-
$get_tokens_by_code->setRequestState($_REQUEST['state']);
|
| 283 |
-
$get_tokens_by_code->setRequestScopes($config_option["scope"]);
|
| 284 |
-
$get_tokens_by_code->request();
|
| 285 |
-
$get_tokens_by_code_array = $get_tokens_by_code->getResponseObject()->data->id_token_claims;
|
| 286 |
-
//var_dump($get_tokens_by_code_array);exit;
|
| 287 |
-
$_SESSION['user_oxd_id_token_admin'] = $get_tokens_by_code->getResponseIdToken();
|
| 288 |
-
$_SESSION['user_oxd_access_token_admin'] = $get_tokens_by_code->getResponseAccessToken();
|
| 289 |
-
$_SESSION['session_state_admin'] = $_REQUEST['session_state'];
|
| 290 |
-
$_SESSION['state_admin'] = $_REQUEST['state'];
|
| 291 |
-
$get_user_info = $this->getGetUserInfo();
|
| 292 |
-
$get_user_info->setRequestOxdId($oxd_id);
|
| 293 |
-
$get_user_info->setRequestAccessToken($_SESSION['user_oxd_access_token_admin']);
|
| 294 |
-
$get_user_info->request();
|
| 295 |
-
$get_user_info_array = $get_user_info->getResponseObject()->data->claims;
|
| 296 |
-
$reg_first_name = '';
|
| 297 |
-
$reg_last_name = '';
|
| 298 |
-
$reg_middle_name = '';
|
| 299 |
-
$reg_email = '';
|
| 300 |
-
$reg_country = '';
|
| 301 |
-
$reg_city = '';
|
| 302 |
-
$reg_region = '';
|
| 303 |
-
$reg_gender = '';
|
| 304 |
-
$reg_postal_code = '';
|
| 305 |
-
$reg_fax = '';
|
| 306 |
-
$reg_home_phone_number = '';
|
| 307 |
-
$reg_phone_mobile_number = '';
|
| 308 |
-
$reg_avatar = '';
|
| 309 |
-
$reg_street_address = '';
|
| 310 |
-
$reg_birthdate = '';
|
| 311 |
-
if($get_user_info_array->given_name[0]){
|
| 312 |
-
$reg_first_name = $get_user_info_array->given_name[0];
|
| 313 |
-
}elseif($get_tokens_by_code_array->given_name[0]){
|
| 314 |
-
$reg_first_name = $get_tokens_by_code_array->given_name[0];
|
| 315 |
-
}
|
| 316 |
-
if($get_user_info_array->family_name[0]){
|
| 317 |
-
$reg_last_name = $get_user_info_array->family_name[0];
|
| 318 |
-
}elseif($get_tokens_by_code_array->family_name[0]){
|
| 319 |
-
$reg_last_name = $get_tokens_by_code_array->family_name[0];
|
| 320 |
-
}
|
| 321 |
-
if($get_user_info_array->middle_name[0]){
|
| 322 |
-
$reg_middle_name = $get_user_info_array->middle_name[0];
|
| 323 |
-
}elseif($get_tokens_by_code_array->middle_name[0]){
|
| 324 |
-
$reg_middle_name = $get_tokens_by_code_array->middle_name[0];
|
| 325 |
-
}
|
| 326 |
-
if($get_user_info_array->email[0]){
|
| 327 |
-
$reg_email = $get_user_info_array->email[0];
|
| 328 |
-
}elseif($get_tokens_by_code_array->email[0]){
|
| 329 |
-
$reg_email = $get_tokens_by_code_array->email[0];
|
| 330 |
-
}
|
| 331 |
-
if($get_user_info_array->country[0]){
|
| 332 |
-
$reg_country = $get_user_info_array->country[0];
|
| 333 |
-
}elseif($get_tokens_by_code_array->country[0]){
|
| 334 |
-
$reg_country = $get_tokens_by_code_array->country[0];
|
| 335 |
-
}
|
| 336 |
-
if($get_user_info_array->gender[0]){
|
| 337 |
-
if($get_user_info_array->gender[0] == 'male'){
|
| 338 |
-
$reg_gender = '1';
|
| 339 |
-
}else{
|
| 340 |
-
$reg_gender = '2';
|
| 341 |
-
}
|
| 342 |
|
| 343 |
-
}elseif($get_tokens_by_code_array->gender[0]){
|
| 344 |
-
if($get_tokens_by_code_array->gender[0] == 'male'){
|
| 345 |
-
$reg_gender = '1';
|
| 346 |
-
}else{
|
| 347 |
-
$reg_gender = '2';
|
| 348 |
-
}
|
| 349 |
-
}
|
| 350 |
-
if($get_user_info_array->locality[0]){
|
| 351 |
-
$reg_city = $get_user_info_array->locality[0];
|
| 352 |
-
}elseif($get_tokens_by_code_array->locality[0]){
|
| 353 |
-
$reg_city = $get_tokens_by_code_array->locality[0];
|
| 354 |
-
}
|
| 355 |
-
if($get_user_info_array->postal_code[0]){
|
| 356 |
-
$reg_postal_code = $get_user_info_array->postal_code[0];
|
| 357 |
-
}elseif($get_tokens_by_code_array->postal_code[0]){
|
| 358 |
-
$reg_postal_code = $get_tokens_by_code_array->postal_code[0];
|
| 359 |
-
}
|
| 360 |
-
if($get_user_info_array->phone_number[0]){
|
| 361 |
-
$reg_home_phone_number = $get_user_info_array->phone_number[0];
|
| 362 |
-
}elseif($get_tokens_by_code_array->phone_number[0]){
|
| 363 |
-
$reg_home_phone_number = $get_tokens_by_code_array->phone_number[0];
|
| 364 |
-
}
|
| 365 |
-
if($get_user_info_array->phone_mobile_number[0]){
|
| 366 |
-
$reg_phone_mobile_number = $get_user_info_array->phone_mobile_number[0];
|
| 367 |
-
}elseif($get_tokens_by_code_array->phone_mobile_number[0]){
|
| 368 |
-
$reg_phone_mobile_number = $get_tokens_by_code_array->phone_mobile_number[0];
|
| 369 |
-
}
|
| 370 |
-
if($get_user_info_array->picture[0]){
|
| 371 |
-
$reg_avatar = $get_user_info_array->picture[0];
|
| 372 |
-
}elseif($get_tokens_by_code_array->picture[0]){
|
| 373 |
-
$reg_avatar = $get_tokens_by_code_array->picture[0];
|
| 374 |
-
}
|
| 375 |
-
if($get_user_info_array->street_address[0]){
|
| 376 |
-
$reg_street_address = $get_user_info_array->street_address[0];
|
| 377 |
-
}elseif($get_tokens_by_code_array->street_address[0]){
|
| 378 |
-
$reg_street_address = $get_tokens_by_code_array->street_address[0];
|
| 379 |
-
}
|
| 380 |
-
if($get_user_info_array->birthdate[0]){
|
| 381 |
-
$reg_birthdate = $get_user_info_array->birthdate[0];
|
| 382 |
-
}elseif($get_tokens_by_code_array->birthdate[0]){
|
| 383 |
-
$reg_birthdate = $get_tokens_by_code_array->birthdate[0];
|
| 384 |
-
}
|
| 385 |
-
if($get_user_info_array->region[0]){
|
| 386 |
-
$reg_region = $get_user_info_array->region[0];
|
| 387 |
-
}elseif($get_tokens_by_code_array->region[0]){
|
| 388 |
-
$reg_region = $get_tokens_by_code_array->region[0];
|
| 389 |
-
}
|
| 390 |
-
if( $reg_email ) {
|
| 391 |
-
# Create New admin User programmatically.
|
| 392 |
-
require_once('./app/Mage.php');
|
| 393 |
-
umask(0);
|
| 394 |
-
Mage::app();
|
| 395 |
-
$user = Mage::getModel('admin/user');
|
| 396 |
-
$data= $user->loadByUsername($reg_email);
|
| 397 |
-
if($user->getId()){
|
| 398 |
-
if ($data->_data['user_id']) {
|
| 399 |
-
if (Mage::getSingleton('adminhtml/url')->useSecretKey()) {
|
| 400 |
-
Mage::getSingleton('adminhtml/url')->renewSecretUrls();
|
| 401 |
-
}
|
| 402 |
-
$session = Mage::getSingleton('admin/session');
|
| 403 |
-
$session->setIsFirstVisit(true);
|
| 404 |
-
$session->setUser($user);
|
| 405 |
-
$session->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());
|
| 406 |
-
if ($requestUri = $this->_getRequestUri(null)) {
|
| 407 |
-
Mage::dispatchEvent('admin_session_user_login_success', array('user'=>$user));
|
| 408 |
-
header('Location: ' . $requestUri);
|
| 409 |
-
exit;
|
| 410 |
-
}
|
| 411 |
-
}
|
| 412 |
-
else {
|
| 413 |
-
Mage::throwException(Mage::helper('adminhtml')->__('Invalid Username or Password.'));
|
| 414 |
-
}
|
| 415 |
-
header("Refresh:0");
|
| 416 |
-
}else{
|
| 417 |
-
$password = md5(Mage::helper('core')->getRandomString($length = 7));
|
| 418 |
-
|
| 419 |
-
$user = Mage::getModel('admin/user')
|
| 420 |
-
->setData(array(
|
| 421 |
-
'username' => $reg_email,
|
| 422 |
-
'firstname' => $reg_first_name,
|
| 423 |
-
'lastname' => $reg_last_name,
|
| 424 |
-
'email' => $reg_email,
|
| 425 |
-
'password' =>$password,
|
| 426 |
-
'is_active' => 1
|
| 427 |
-
))->save();
|
| 428 |
-
$role = Mage::getModel("admin/role");
|
| 429 |
-
$role->setParent_id(1);
|
| 430 |
-
$role->setTree_level(2);
|
| 431 |
-
$role->setRole_type('U');
|
| 432 |
-
$role->setUser_id($user->getId());
|
| 433 |
-
$role->setRole_name($user->getFirstname());
|
| 434 |
-
$role->save();
|
| 435 |
-
$user = Mage::getModel('admin/user');
|
| 436 |
-
$user->login($reg_email, $password);
|
| 437 |
-
if ($user->getId()) {
|
| 438 |
-
if (Mage::getSingleton('adminhtml/url')->useSecretKey()) {
|
| 439 |
-
Mage::getSingleton('adminhtml/url')->renewSecretUrls();
|
| 440 |
-
}
|
| 441 |
-
$session = Mage::getSingleton('admin/session');
|
| 442 |
-
$session->setIsFirstVisit(true);
|
| 443 |
-
$session->setUser($user);
|
| 444 |
-
$session->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());
|
| 445 |
-
if ($requestUri = $this->_getRequestUri(null)) {
|
| 446 |
-
Mage::dispatchEvent('admin_session_user_login_success', array('user'=>$user));
|
| 447 |
-
header('Location: ' . $requestUri);
|
| 448 |
-
exit;
|
| 449 |
-
}
|
| 450 |
-
}
|
| 451 |
-
else {
|
| 452 |
-
Mage::throwException(Mage::helper('adminhtml')->__('Invalid Username or Password.'));
|
| 453 |
-
}
|
| 454 |
-
|
| 455 |
-
}
|
| 456 |
-
}else{
|
| 457 |
-
echo '<p style="color: red">Sorry, but gluu server cannot find email address!</p>';
|
| 458 |
-
}
|
| 459 |
-
}
|
| 460 |
-
if( isset( $_REQUEST['option'] ) and strpos( $_REQUEST['option'], 'userGluuLoginAdmin' ) !== false ) {
|
| 461 |
-
$config_option = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config' ));
|
| 462 |
-
$oxd_id = Mage::getStoreConfig ( 'gluu/oxd/oxd_id_admin' );
|
| 463 |
-
$get_authorization_url = $this->getGetAuthorizationUrl();
|
| 464 |
-
$get_authorization_url->setRequestOxdId($oxd_id);
|
| 465 |
-
$get_authorization_url->setRequestAcrValues([$_REQUEST['app_name']]);
|
| 466 |
-
$get_authorization_url->request();
|
| 467 |
-
//var_dump($get_authorization_url->getResponseObject());exit;
|
| 468 |
-
if($get_authorization_url->getResponseAuthorizationUrl()){
|
| 469 |
-
header("Location: ".$get_authorization_url->getResponseAuthorizationUrl());
|
| 470 |
-
exit;
|
| 471 |
-
}else{
|
| 472 |
-
echo '<p style="color: red">Sorry, but oxd server is not switched on!</p>';
|
| 473 |
-
}
|
| 474 |
-
}
|
| 475 |
-
}
|
| 476 |
/**
|
| 477 |
* getting login page validateing
|
| 478 |
* return @string
|
|
@@ -490,6 +254,7 @@ class GluuOxd_Openid_Block_GluuOxOpenidConfig extends Mage_Core_Block_Template{
|
|
| 490 |
$get_tokens_by_code->setRequestScopes($config_option["scope"]);
|
| 491 |
$get_tokens_by_code->request();
|
| 492 |
$get_tokens_by_code_array = $get_tokens_by_code->getResponseObject()->data->id_token_claims;
|
|
|
|
| 493 |
$_SESSION['user_oxd_id_token'] = $get_tokens_by_code->getResponseIdToken();
|
| 494 |
$_SESSION['user_oxd_access_token'] = $get_tokens_by_code->getResponseAccessToken();
|
| 495 |
$_SESSION['session_state'] = $_REQUEST['session_state'];
|
|
@@ -500,6 +265,7 @@ class GluuOxd_Openid_Block_GluuOxOpenidConfig extends Mage_Core_Block_Template{
|
|
| 500 |
$get_user_info->setRequestAccessToken($_SESSION['user_oxd_access_token']);
|
| 501 |
$get_user_info->request();
|
| 502 |
$get_user_info_array = $get_user_info->getResponseObject()->data->claims;
|
|
|
|
| 503 |
$reg_first_name = '';
|
| 504 |
$reg_last_name = '';
|
| 505 |
$reg_middle_name = '';
|
|
@@ -678,7 +444,6 @@ class GluuOxd_Openid_Block_GluuOxOpenidConfig extends Mage_Core_Block_Template{
|
|
| 678 |
}
|
| 679 |
}
|
| 680 |
if( isset( $_REQUEST['option'] ) and strpos( $_REQUEST['option'], 'userGluuLogin' ) !== false ) {
|
| 681 |
-
|
| 682 |
$config_option = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config' ));
|
| 683 |
$oxd_id = Mage::getStoreConfig ( 'gluu/oxd/oxd_id' );
|
| 684 |
$get_authorization_url = $this->getGetAuthorizationUrl();
|
| 10 |
private $getUserInfo = "GluuOxd_Openid/getUserInfo";
|
| 11 |
private $logout = "GluuOxd_Openid/logout";
|
| 12 |
|
|
|
|
| 13 |
/**
|
| 14 |
* Administrator logout action
|
| 15 |
*/
|
| 28 |
$logout->request();
|
| 29 |
header("Location: ".$logout->getResponseObject()->data->uri);
|
| 30 |
exit;
|
| 31 |
+
//echo "<a href='".$logout->getResponseObject()->data->uri."'>Logout from all sites.</a>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
}
|
| 34 |
|
| 35 |
}
|
| 36 |
+
|
| 37 |
/**
|
| 38 |
* @return string
|
| 39 |
*/
|
| 236 |
public function getOpenIdAdminUrl(){
|
| 237 |
return Mage::helper("adminhtml")->getUrl("*/index/index");
|
| 238 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
/**
|
| 241 |
* getting login page validateing
|
| 242 |
* return @string
|
| 254 |
$get_tokens_by_code->setRequestScopes($config_option["scope"]);
|
| 255 |
$get_tokens_by_code->request();
|
| 256 |
$get_tokens_by_code_array = $get_tokens_by_code->getResponseObject()->data->id_token_claims;
|
| 257 |
+
|
| 258 |
$_SESSION['user_oxd_id_token'] = $get_tokens_by_code->getResponseIdToken();
|
| 259 |
$_SESSION['user_oxd_access_token'] = $get_tokens_by_code->getResponseAccessToken();
|
| 260 |
$_SESSION['session_state'] = $_REQUEST['session_state'];
|
| 265 |
$get_user_info->setRequestAccessToken($_SESSION['user_oxd_access_token']);
|
| 266 |
$get_user_info->request();
|
| 267 |
$get_user_info_array = $get_user_info->getResponseObject()->data->claims;
|
| 268 |
+
|
| 269 |
$reg_first_name = '';
|
| 270 |
$reg_last_name = '';
|
| 271 |
$reg_middle_name = '';
|
| 444 |
}
|
| 445 |
}
|
| 446 |
if( isset( $_REQUEST['option'] ) and strpos( $_REQUEST['option'], 'userGluuLogin' ) !== false ) {
|
|
|
|
| 447 |
$config_option = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config' ));
|
| 448 |
$oxd_id = Mage::getStoreConfig ( 'gluu/oxd/oxd_id' );
|
| 449 |
$get_authorization_url = $this->getGetAuthorizationUrl();
|
app/code/community/GluuOxd/Openid/Helper/RegisterSite.php
CHANGED
|
@@ -278,7 +278,7 @@ class GluuOxd_Openid_Helper_RegisterSite extends GluuOxd_Openid_Helper_ClientOXD
|
|
| 278 |
"contacts" => $this->getRequestContacts(),
|
| 279 |
"grant_types" => $this->getRequestGrantTypes(),
|
| 280 |
"response_types"=> $this->getRequestResponseTypes(),
|
| 281 |
-
"
|
| 282 |
);
|
| 283 |
}
|
| 284 |
|
| 278 |
"contacts" => $this->getRequestContacts(),
|
| 279 |
"grant_types" => $this->getRequestGrantTypes(),
|
| 280 |
"response_types"=> $this->getRequestResponseTypes(),
|
| 281 |
+
"client_logout_uris"=> [$this->getRequestClientLogoutUri()]
|
| 282 |
);
|
| 283 |
}
|
| 284 |
|
app/code/community/GluuOxd/Openid/Helper/UpdateSiteRegistration.php
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Created Vlad Karapetyan
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
require_once 'ClientOXDRP.php';
|
| 7 |
+
|
| 8 |
+
class GluuOxd_Openid_Helper_UpdateSiteRegistration extends GluuOxd_Openid_Helper_ClientOXDRP
|
| 9 |
+
{
|
| 10 |
+
/**start parameter for request!**/
|
| 11 |
+
private $request_authorization_redirect_uri = null;
|
| 12 |
+
private $request_logout_redirect_uri = null;
|
| 13 |
+
private $request_application_type = null;
|
| 14 |
+
private $request_redirect_uris = null;
|
| 15 |
+
private $request_acr_values = null;
|
| 16 |
+
private $request_client_jwks_uri = null;
|
| 17 |
+
private $request_client_token_endpoint_auth_method = null;
|
| 18 |
+
private $request_client_request_uris = null;
|
| 19 |
+
private $request_contacts = null;
|
| 20 |
+
private $request_scope = null;
|
| 21 |
+
private $request_grant_types = null;
|
| 22 |
+
private $request_response_types = null;
|
| 23 |
+
private $request_client_logout_uri = null;
|
| 24 |
+
private $request_oxd_id = null;
|
| 25 |
+
/**end request parameter**/
|
| 26 |
+
|
| 27 |
+
/**start parameter for response!**/
|
| 28 |
+
private $response_oxd_id;
|
| 29 |
+
/**end response parameter**/
|
| 30 |
+
|
| 31 |
+
public function __construct()
|
| 32 |
+
{
|
| 33 |
+
parent::__construct(); // TODO: Change the autogenerated stub
|
| 34 |
+
$this->setRequestApplicationType();
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
/**
|
| 38 |
+
* @return null
|
| 39 |
+
*/
|
| 40 |
+
public function getRequestClientLogoutUri()
|
| 41 |
+
{
|
| 42 |
+
return $this->request_client_logout_uri;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
/**
|
| 46 |
+
* @param null $request_client_logout_uri
|
| 47 |
+
*/
|
| 48 |
+
public function setRequestClientLogoutUri($request_client_logout_uri)
|
| 49 |
+
{
|
| 50 |
+
$this->request_client_logout_uri = $request_client_logout_uri;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
/**
|
| 54 |
+
* @return null
|
| 55 |
+
*/
|
| 56 |
+
public function getRequestResponseTypes()
|
| 57 |
+
{
|
| 58 |
+
return $this->request_response_types;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
/**
|
| 62 |
+
* @param null $request_response_types
|
| 63 |
+
*/
|
| 64 |
+
public function setRequestResponseTypes($request_response_types)
|
| 65 |
+
{
|
| 66 |
+
$this->request_response_types = $request_response_types;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
/**
|
| 70 |
+
* @return null
|
| 71 |
+
*/
|
| 72 |
+
public function getRequestGrantTypes()
|
| 73 |
+
{
|
| 74 |
+
return $this->request_grant_types;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
/**
|
| 78 |
+
* @param null $request_grant_types
|
| 79 |
+
*/
|
| 80 |
+
public function setRequestGrantTypes($request_grant_types)
|
| 81 |
+
{
|
| 82 |
+
$this->request_grant_types = $request_grant_types;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
/**
|
| 86 |
+
* @return null
|
| 87 |
+
*/
|
| 88 |
+
public function getRequestScope()
|
| 89 |
+
{
|
| 90 |
+
return $this->request_scope;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
/**
|
| 94 |
+
* @param null $request_scope
|
| 95 |
+
*/
|
| 96 |
+
public function setRequestScope($request_scope)
|
| 97 |
+
{
|
| 98 |
+
$this->request_scope = $request_scope;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
/**
|
| 102 |
+
* @return null
|
| 103 |
+
*/
|
| 104 |
+
public function getRequestLogoutRedirectUri()
|
| 105 |
+
{
|
| 106 |
+
return $this->request_logout_redirect_uri;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
/**
|
| 110 |
+
* @param null $request_logout_redirect_uri
|
| 111 |
+
*/
|
| 112 |
+
public function setRequestLogoutRedirectUri($request_logout_redirect_uri)
|
| 113 |
+
{
|
| 114 |
+
$this->request_logout_redirect_uri = $request_logout_redirect_uri;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
/**
|
| 118 |
+
* @return null
|
| 119 |
+
*/
|
| 120 |
+
public function getRequestClientJwksUri()
|
| 121 |
+
{
|
| 122 |
+
return $this->request_client_jwks_uri;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
/**
|
| 126 |
+
* @param null $request_client_jwks_uri
|
| 127 |
+
*/
|
| 128 |
+
public function setRequestClientJwksUri($request_client_jwks_uri)
|
| 129 |
+
{
|
| 130 |
+
$this->request_client_jwks_uri = $request_client_jwks_uri;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
/**
|
| 134 |
+
* @return null
|
| 135 |
+
*/
|
| 136 |
+
public function getRequestClientTokenEndpointAuthMethod()
|
| 137 |
+
{
|
| 138 |
+
return $this->request_client_token_endpoint_auth_method;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
/**
|
| 142 |
+
* @param null $request_client_token_endpoint_auth_method
|
| 143 |
+
*/
|
| 144 |
+
public function setRequestClientTokenEndpointAuthMethod($request_client_token_endpoint_auth_method)
|
| 145 |
+
{
|
| 146 |
+
$this->request_client_token_endpoint_auth_method = $request_client_token_endpoint_auth_method;
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
/**
|
| 150 |
+
* @return null
|
| 151 |
+
*/
|
| 152 |
+
public function getRequestClientRequestUris()
|
| 153 |
+
{
|
| 154 |
+
return $this->request_client_request_uris;
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
/**
|
| 158 |
+
* @param null $request_client_request_uris
|
| 159 |
+
*/
|
| 160 |
+
public function setRequestClientRequestUris($request_client_request_uris)
|
| 161 |
+
{
|
| 162 |
+
$this->request_client_request_uris = $request_client_request_uris;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
/**
|
| 166 |
+
* @return mixed
|
| 167 |
+
*/
|
| 168 |
+
public function getRequestApplicationType()
|
| 169 |
+
{
|
| 170 |
+
return $this->request_application_type;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
/**
|
| 174 |
+
* @param mixed $request_application_type
|
| 175 |
+
*/
|
| 176 |
+
public function setRequestApplicationType($request_application_type = 'web')
|
| 177 |
+
{
|
| 178 |
+
$this->request_application_type = $request_application_type;
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
/**
|
| 182 |
+
* @return null
|
| 183 |
+
*/
|
| 184 |
+
public function getRequestAuthorizationRedirectUri()
|
| 185 |
+
{
|
| 186 |
+
return $this->request_authorization_redirect_uri;
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
/**
|
| 190 |
+
* @param null $request_authorization_redirect_uri
|
| 191 |
+
*/
|
| 192 |
+
public function setRequestAuthorizationRedirectUri($request_authorization_redirect_uri)
|
| 193 |
+
{
|
| 194 |
+
$this->request_authorization_redirect_uri = $request_authorization_redirect_uri;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
/**
|
| 198 |
+
* @return null
|
| 199 |
+
*/
|
| 200 |
+
public function getRequestRedirectUris()
|
| 201 |
+
{
|
| 202 |
+
return $this->request_redirect_uris;
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
/**
|
| 206 |
+
* @param null $request_redirect_uris
|
| 207 |
+
*/
|
| 208 |
+
public function setRequestRedirectUris($request_redirect_uris)
|
| 209 |
+
{
|
| 210 |
+
$this->request_redirect_uris = $request_redirect_uris;
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
/**
|
| 214 |
+
* @return null
|
| 215 |
+
*/
|
| 216 |
+
public function getRequestAcrValues()
|
| 217 |
+
{
|
| 218 |
+
return $this->request_acr_values;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
/**
|
| 222 |
+
* @param null $request_acr_values
|
| 223 |
+
*/
|
| 224 |
+
public function setRequestAcrValues($request_acr_values = 'basic')
|
| 225 |
+
{
|
| 226 |
+
$this->request_acr_values = $request_acr_values;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
/**
|
| 230 |
+
* @return null
|
| 231 |
+
*/
|
| 232 |
+
public function getRequestContacts()
|
| 233 |
+
{
|
| 234 |
+
return $this->request_contacts;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
/**
|
| 238 |
+
* @param null $request_contacts
|
| 239 |
+
*/
|
| 240 |
+
public function setRequestContacts($request_contacts)
|
| 241 |
+
{
|
| 242 |
+
$this->request_contacts = $request_contacts;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
/**
|
| 246 |
+
* @return mixed
|
| 247 |
+
*/
|
| 248 |
+
public function getResponseOxdId()
|
| 249 |
+
{
|
| 250 |
+
$this->response_oxd_id = $this->getResponseData()->oxd_id;
|
| 251 |
+
return $this->response_oxd_id;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
/**
|
| 255 |
+
* @param mixed $response_oxd_id
|
| 256 |
+
*/
|
| 257 |
+
public function setResponseOxdId($response_oxd_id)
|
| 258 |
+
{
|
| 259 |
+
$this->response_oxd_id = $response_oxd_id;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
public function setCommand()
|
| 263 |
+
{
|
| 264 |
+
$this->command = 'update_site_registration';
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
/**
|
| 268 |
+
* @return null
|
| 269 |
+
*/
|
| 270 |
+
public function getRequestOxdId()
|
| 271 |
+
{
|
| 272 |
+
return $this->request_oxd_id;
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
/**
|
| 276 |
+
* @param null $request_oxd_id
|
| 277 |
+
*/
|
| 278 |
+
public function setRequestOxdId($request_oxd_id)
|
| 279 |
+
{
|
| 280 |
+
$this->request_oxd_id = $request_oxd_id;
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
public function setParams()
|
| 284 |
+
{
|
| 285 |
+
$this->params = array(
|
| 286 |
+
"authorization_redirect_uri" => $this->getRequestAuthorizationRedirectUri(),
|
| 287 |
+
"oxd_id" => $this->getRequestOxdId(),
|
| 288 |
+
"post_logout_redirect_uri" => $this->getRequestLogoutRedirectUri(),
|
| 289 |
+
"application_type" => $this->getRequestApplicationType(),
|
| 290 |
+
"redirect_uris" => $this->getRequestRedirectUris(),
|
| 291 |
+
"acr_values" => $this->getRequestAcrValues(),
|
| 292 |
+
"scope" => $this->getRequestScope(),
|
| 293 |
+
"client_jwks_uri" => $this->getRequestClientJwksUri(),
|
| 294 |
+
"client_token_endpoint_auth_method" => $this->getRequestClientTokenEndpointAuthMethod(),
|
| 295 |
+
"client_request_uris" => $this->getRequestClientRequestUris(),
|
| 296 |
+
"contacts" => $this->getRequestContacts(),
|
| 297 |
+
"grant_types" => $this->getRequestGrantTypes(),
|
| 298 |
+
"response_types"=> $this->getRequestResponseTypes(),
|
| 299 |
+
"client_secret_expires_at"=> 1916258400,
|
| 300 |
+
"client_logout_uris"=> [$this->getRequestClientLogoutUri()]
|
| 301 |
+
);
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
}
|
app/code/community/GluuOxd/Openid/controllers/Adminhtml/IndexController.php
CHANGED
|
@@ -8,18 +8,8 @@ class GluuOxd_Openid_Adminhtml_IndexController extends Mage_Adminhtml_Controller
|
|
| 8 |
{
|
| 9 |
private $dataHelper = "GluuOxd_Openid";
|
| 10 |
private $oxdRegisterSiteHelper = "GluuOxd_Openid/registerSite";
|
|
|
|
| 11 |
|
| 12 |
-
public function logoutAction()
|
| 13 |
-
{
|
| 14 |
-
echo 'ssdadad';exit;
|
| 15 |
-
/** @var $adminSession Mage_Admin_Model_Session */
|
| 16 |
-
$adminSession = Mage::getSingleton('admin/session');
|
| 17 |
-
$adminSession->unsetAll();
|
| 18 |
-
$adminSession->getCookie()->delete($adminSession->getSessionName());
|
| 19 |
-
$adminSession->addSuccess(Mage::helper('adminhtml')->__('You have logged out.'));
|
| 20 |
-
|
| 21 |
-
$this->_redirect('*');
|
| 22 |
-
}
|
| 23 |
/**
|
| 24 |
* @return string
|
| 25 |
*/
|
|
@@ -27,12 +17,21 @@ class GluuOxd_Openid_Adminhtml_IndexController extends Mage_Adminhtml_Controller
|
|
| 27 |
{
|
| 28 |
return Mage::helper($this->oxdRegisterSiteHelper);
|
| 29 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
/**
|
| 31 |
* @return gluuOxd admin index page
|
| 32 |
*/
|
| 33 |
public function indexAction(){
|
| 34 |
|
|
|
|
| 35 |
$storeConfig = new Mage_Core_Model_Config();
|
|
|
|
| 36 |
if(empty(unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config' )))){
|
| 37 |
|
| 38 |
$config_option = array(
|
|
@@ -51,23 +50,6 @@ class GluuOxd_Openid_Adminhtml_IndexController extends Mage_Adminhtml_Controller
|
|
| 51 |
if(empty(unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config' )))){
|
| 52 |
$storeConfig ->saveConfig('gluu/oxd/oxd_config',serialize($config_option), 'default', 0);
|
| 53 |
}
|
| 54 |
-
|
| 55 |
-
$config_option_admin = array(
|
| 56 |
-
"oxd_host_ip" => '127.0.0.1',
|
| 57 |
-
"oxd_host_port" =>8099,
|
| 58 |
-
"admin_email" => Mage::getSingleton('admin/session')->getUser()->getEmail(),
|
| 59 |
-
"authorization_redirect_uri" => $this->getUrl('adminhtml').'?option=getOxdSocialLogin',
|
| 60 |
-
"logout_redirect_uri" => $this->getUrl('adminhtml/index/logout'),
|
| 61 |
-
"scope" => ["openid", "profile","email","address", "clientinfo", "mobile_phone", "phone"],
|
| 62 |
-
"grant_types" =>["authorization_code"],
|
| 63 |
-
"response_types" => ["code"],
|
| 64 |
-
"application_type" => "web",
|
| 65 |
-
"redirect_uris" => [ $this->getUrl('adminhtml').'?option=getOxdSocialLogin' ],
|
| 66 |
-
"acr_values" => [],
|
| 67 |
-
);
|
| 68 |
-
if(empty(unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config_admin' )))){
|
| 69 |
-
$storeConfig ->saveConfig('gluu/oxd/oxd_config_admin',serialize($config_option_admin), 'default', 0);
|
| 70 |
-
}
|
| 71 |
}
|
| 72 |
if(empty(unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_openid_scops' )))){
|
| 73 |
$storeConfig ->saveConfig('gluu/oxd/oxd_openid_scops',serialize(array("openid", "profile","email","address", "clientinfo", "mobile_phone", "phone")), 'default', 0);
|
|
@@ -170,27 +152,6 @@ class GluuOxd_Openid_Adminhtml_IndexController extends Mage_Adminhtml_Controller
|
|
| 170 |
}
|
| 171 |
if($registerSite->getResponseOxdId()){
|
| 172 |
$storeConfig ->saveConfig('gluu/oxd/oxd_id',$registerSite->getResponseOxdId(), 'default', 0);
|
| 173 |
-
$config_option_admin = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config_admin' ));
|
| 174 |
-
$config_option_admin['oxd_host_port'] = $params['oxd_port'];
|
| 175 |
-
|
| 176 |
-
$config_option_admin['admin_email'] = $email;
|
| 177 |
-
$storeConfig ->saveConfig('gluu/oxd/oxd_config_admin',serialize($config_option), 'default', 0);
|
| 178 |
-
$config_option_admin = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config_admin' ));
|
| 179 |
-
|
| 180 |
-
$registerSiteAdmin = $this->getOxdRegisterSiteHelper();
|
| 181 |
-
$registerSiteAdmin->setOxdHostPort($params['oxd_port']);
|
| 182 |
-
$registerSiteAdmin->setRequestAcrValues($config_option_admin['acr_values']);
|
| 183 |
-
$registerSiteAdmin->setRequestAuthorizationRedirectUri($config_option_admin['authorization_redirect_uri']);
|
| 184 |
-
$registerSiteAdmin->setRequestRedirectUris($config_option_admin['redirect_uris']);
|
| 185 |
-
$registerSiteAdmin->setRequestLogoutRedirectUri($config_option_admin['logout_redirect_uri']);
|
| 186 |
-
$registerSiteAdmin->setRequestContacts([$config_option_admin['admin_email']]);
|
| 187 |
-
$registerSiteAdmin->setRequestApplicationType('web');
|
| 188 |
-
$registerSiteAdmin->setRequestScope($config_option_admin['scope']);
|
| 189 |
-
$registerSiteAdmin->setRequestGrantTypes($config_option_admin['grant_types']);
|
| 190 |
-
$registerSiteAdmin->setRequestResponseTypes($config_option_admin['response_types']);
|
| 191 |
-
$registerSiteAdmin->setRequestClientLogoutUri($config_option_admin['logout_redirect_uri']);
|
| 192 |
-
$status = $registerSiteAdmin->request();
|
| 193 |
-
$storeConfig ->saveConfig('gluu/oxd/oxd_id_admin',$registerSiteAdmin->getResponseOxdId(), 'default', 0);
|
| 194 |
$datahelper->displayMessage('Site registered Successful. You can configure Gluu and Social Login now.',"SUCCESS");
|
| 195 |
$this->redirect("*/*/index");
|
| 196 |
return;
|
|
@@ -207,10 +168,8 @@ class GluuOxd_Openid_Adminhtml_IndexController extends Mage_Adminhtml_Controller
|
|
| 207 |
$setup ->deleteConfig('GluuOxd/Openid/'.$custom_script['value'].'Enable');
|
| 208 |
}
|
| 209 |
$setup->deleteConfig('gluu/oxd/oxd_id');
|
| 210 |
-
$setup->deleteConfig('gluu/oxd/oxd_id_admin');
|
| 211 |
$setup->deleteConfig('gluu/oxd/oxd_openid_scops');
|
| 212 |
$setup->deleteConfig('gluu/oxd/oxd_config');
|
| 213 |
-
$setup->deleteConfig('gluu/oxd/oxd_config_admin');
|
| 214 |
$setup->deleteConfig('gluu/oxd/oxd_openid_scops');
|
| 215 |
$setup->deleteConfig('gluu/oxd/oxd_openid_custom_scripts');
|
| 216 |
|
|
@@ -296,6 +255,28 @@ class GluuOxd_Openid_Adminhtml_IndexController extends Mage_Adminhtml_Controller
|
|
| 296 |
$oxd_config['scope'] = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config' ));
|
| 297 |
}
|
| 298 |
$storeConfig ->saveConfig('gluu/oxd/oxd_config',serialize($oxd_config), 'default', 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 299 |
$datahelper->displayMessage($message,"SUCCESS");
|
| 300 |
$this->redirect("*/*/index");
|
| 301 |
}
|
| 8 |
{
|
| 9 |
private $dataHelper = "GluuOxd_Openid";
|
| 10 |
private $oxdRegisterSiteHelper = "GluuOxd_Openid/registerSite";
|
| 11 |
+
private $oxdUpdateSiteRegistrationHelper = "GluuOxd_Openid/updateSiteRegistration";
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
/**
|
| 14 |
* @return string
|
| 15 |
*/
|
| 17 |
{
|
| 18 |
return Mage::helper($this->oxdRegisterSiteHelper);
|
| 19 |
}
|
| 20 |
+
/**
|
| 21 |
+
* @return string
|
| 22 |
+
*/
|
| 23 |
+
public function getOxdUpdateSiteRegistrationHelper()
|
| 24 |
+
{
|
| 25 |
+
return Mage::helper($this->oxdUpdateSiteRegistrationHelper);
|
| 26 |
+
}
|
| 27 |
/**
|
| 28 |
* @return gluuOxd admin index page
|
| 29 |
*/
|
| 30 |
public function indexAction(){
|
| 31 |
|
| 32 |
+
|
| 33 |
$storeConfig = new Mage_Core_Model_Config();
|
| 34 |
+
|
| 35 |
if(empty(unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config' )))){
|
| 36 |
|
| 37 |
$config_option = array(
|
| 50 |
if(empty(unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config' )))){
|
| 51 |
$storeConfig ->saveConfig('gluu/oxd/oxd_config',serialize($config_option), 'default', 0);
|
| 52 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
}
|
| 54 |
if(empty(unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_openid_scops' )))){
|
| 55 |
$storeConfig ->saveConfig('gluu/oxd/oxd_openid_scops',serialize(array("openid", "profile","email","address", "clientinfo", "mobile_phone", "phone")), 'default', 0);
|
| 152 |
}
|
| 153 |
if($registerSite->getResponseOxdId()){
|
| 154 |
$storeConfig ->saveConfig('gluu/oxd/oxd_id',$registerSite->getResponseOxdId(), 'default', 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
$datahelper->displayMessage('Site registered Successful. You can configure Gluu and Social Login now.',"SUCCESS");
|
| 156 |
$this->redirect("*/*/index");
|
| 157 |
return;
|
| 168 |
$setup ->deleteConfig('GluuOxd/Openid/'.$custom_script['value'].'Enable');
|
| 169 |
}
|
| 170 |
$setup->deleteConfig('gluu/oxd/oxd_id');
|
|
|
|
| 171 |
$setup->deleteConfig('gluu/oxd/oxd_openid_scops');
|
| 172 |
$setup->deleteConfig('gluu/oxd/oxd_config');
|
|
|
|
| 173 |
$setup->deleteConfig('gluu/oxd/oxd_openid_scops');
|
| 174 |
$setup->deleteConfig('gluu/oxd/oxd_openid_custom_scripts');
|
| 175 |
|
| 255 |
$oxd_config['scope'] = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config' ));
|
| 256 |
}
|
| 257 |
$storeConfig ->saveConfig('gluu/oxd/oxd_config',serialize($oxd_config), 'default', 0);
|
| 258 |
+
|
| 259 |
+
$config_option = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_config' ));
|
| 260 |
+
$updateSiteRegistration = $this->getOxdUpdateSiteRegistrationHelper();
|
| 261 |
+
$updateSiteRegistration->setRequestOxdId(Mage::getStoreConfig ( 'gluu/oxd/oxd_id' ));
|
| 262 |
+
$updateSiteRegistration->setRequestAcrValues($config_option['acr_values']);
|
| 263 |
+
$updateSiteRegistration->setRequestAuthorizationRedirectUri($config_option['authorization_redirect_uri']);
|
| 264 |
+
$updateSiteRegistration->setRequestRedirectUris($config_option['redirect_uris']);
|
| 265 |
+
$updateSiteRegistration->setRequestLogoutRedirectUri($config_option['logout_redirect_uri']);
|
| 266 |
+
$updateSiteRegistration->setRequestContacts([$config_option['admin_email']]);
|
| 267 |
+
$updateSiteRegistration->setRequestApplicationType('web');
|
| 268 |
+
$updateSiteRegistration->setRequestScope($config_option['scope']);
|
| 269 |
+
$updateSiteRegistration->setRequestGrantTypes($config_option['grant_types']);
|
| 270 |
+
$updateSiteRegistration->setRequestResponseTypes($config_option['response_types']);
|
| 271 |
+
$updateSiteRegistration->setRequestClientLogoutUri($config_option['logout_redirect_uri']);
|
| 272 |
+
$status = $updateSiteRegistration->request();
|
| 273 |
+
if(!$status['status']){
|
| 274 |
+
$datahelper->displayMessage($status['message'],"ERROR");
|
| 275 |
+
$this->redirect("*/*/index");
|
| 276 |
+
return;
|
| 277 |
+
}
|
| 278 |
+
$storeConfig ->saveConfig('gluu/oxd/oxd_id',$updateSiteRegistration->getResponseOxdId(), 'default', 0);
|
| 279 |
+
|
| 280 |
$datahelper->displayMessage($message,"SUCCESS");
|
| 281 |
$this->redirect("*/*/index");
|
| 282 |
}
|
app/code/community/GluuOxd/Openid/etc/GluuOxd_module.xml
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<GluuOxd_Openid>
|
| 5 |
+
<version>1.0.0</version>
|
| 6 |
+
<active>true</active>
|
| 7 |
+
<codePool>community</codePool>
|
| 8 |
+
</GluuOxd_Openid>
|
| 9 |
+
</modules>
|
| 10 |
+
<frontend>
|
| 11 |
+
<routers>
|
| 12 |
+
<GluuOxd_Openid_customer>
|
| 13 |
+
<use>standard</use>
|
| 14 |
+
<args>
|
| 15 |
+
<module>GluuOxd_Openid_Customer</module>
|
| 16 |
+
<frontName>sociallogin</frontName>
|
| 17 |
+
</args>
|
| 18 |
+
</GluuOxd_Openid_customer>
|
| 19 |
+
</routers>
|
| 20 |
+
<layout>
|
| 21 |
+
<updates>
|
| 22 |
+
<GluuOxd_Openid_layout>
|
| 23 |
+
<file>GluuOxd_Openid_layout.xml</file>
|
| 24 |
+
</GluuOxd_Openid_layout>
|
| 25 |
+
</updates>
|
| 26 |
+
</layout>
|
| 27 |
+
</frontend>
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
<admin>
|
| 31 |
+
<routers>
|
| 32 |
+
<GluuOxd_Openid>
|
| 33 |
+
<use>admin</use>
|
| 34 |
+
<args>
|
| 35 |
+
<module>GluuOxd_Openid</module>
|
| 36 |
+
<frontName>openid</frontName>
|
| 37 |
+
</args>
|
| 38 |
+
</GluuOxd_Openid>
|
| 39 |
+
</routers>
|
| 40 |
+
</admin>
|
| 41 |
+
|
| 42 |
+
<adminhtml>
|
| 43 |
+
<layout>
|
| 44 |
+
<updates>
|
| 45 |
+
<GluuOxd_Openid_admin_layout>
|
| 46 |
+
<file>GluuOxd_Openid.xml</file>
|
| 47 |
+
</GluuOxd_Openid_admin_layout>
|
| 48 |
+
</updates>
|
| 49 |
+
</layout>
|
| 50 |
+
|
| 51 |
+
<menu>
|
| 52 |
+
<GluuOxdOpenId translate="title" module="GluuOxd_Openid">
|
| 53 |
+
<title>GluuOxd OpenId</title>
|
| 54 |
+
<sort_order>82</sort_order>
|
| 55 |
+
<children>
|
| 56 |
+
<configure_extension translate="title" module="GluuOxd_Openid">
|
| 57 |
+
<title>Gluu and Social Login </title>
|
| 58 |
+
<sort_order>1</sort_order>
|
| 59 |
+
<action>openid/adminhtml_index</action>
|
| 60 |
+
</configure_extension>
|
| 61 |
+
</children>
|
| 62 |
+
</GluuOxdOpenId>
|
| 63 |
+
</menu>
|
| 64 |
+
</adminhtml>
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
<global>
|
| 68 |
+
|
| 69 |
+
<blocks>
|
| 70 |
+
<GluuOxd_Openid>
|
| 71 |
+
<class>GluuOxd_Openid_Block</class>
|
| 72 |
+
</GluuOxd_Openid>
|
| 73 |
+
</blocks>
|
| 74 |
+
|
| 75 |
+
<helpers>
|
| 76 |
+
<GluuOxd_Openid>
|
| 77 |
+
<class>GluuOxd_Openid_Helper</class>
|
| 78 |
+
</GluuOxd_Openid>
|
| 79 |
+
</helpers>
|
| 80 |
+
|
| 81 |
+
</global>
|
| 82 |
+
|
| 83 |
+
</config>
|
app/code/community/GluuOxd/Openid/etc/config.xml
CHANGED
|
@@ -44,7 +44,7 @@
|
|
| 44 |
</layout>
|
| 45 |
<menu>
|
| 46 |
<GluuOxdOpenid translate="title" module="GluuOxd_Openid">
|
| 47 |
-
<title>Gluu SSO 2.4.
|
| 48 |
<sort_order>81</sort_order>
|
| 49 |
<children>
|
| 50 |
<configure_extension translate="title" module="GluuOxd_Openid">
|
| 44 |
</layout>
|
| 45 |
<menu>
|
| 46 |
<GluuOxdOpenid translate="title" module="GluuOxd_Openid">
|
| 47 |
+
<title>Gluu SSO 2.4.3</title>
|
| 48 |
<sort_order>81</sort_order>
|
| 49 |
<children>
|
| 50 |
<configure_extension translate="title" module="GluuOxd_Openid">
|
app/design/adminhtml/default/default/layout/GluuOxd_Openid.xml
CHANGED
|
@@ -5,11 +5,9 @@
|
|
| 5 |
<block type="GluuOxd_Openid/GluuOxOpenidConfig" name="test" template="gluuoxd_openid/gluuOxOpenidConfig.phtml" />
|
| 6 |
</reference>
|
| 7 |
</gluuoxd_openid_adminhtml_index_index>
|
| 8 |
-
|
| 9 |
<adminhtml_index_login>
|
| 10 |
-
<reference name="
|
| 11 |
-
<block type="GluuOxd_Openid/GluuOxOpenidConfig"
|
| 12 |
-
</block>
|
| 13 |
</reference>
|
| 14 |
</adminhtml_index_login>
|
| 15 |
</layout>
|
| 5 |
<block type="GluuOxd_Openid/GluuOxOpenidConfig" name="test" template="gluuoxd_openid/gluuOxOpenidConfig.phtml" />
|
| 6 |
</reference>
|
| 7 |
</gluuoxd_openid_adminhtml_index_index>
|
|
|
|
| 8 |
<adminhtml_index_login>
|
| 9 |
+
<reference name="form.additional.info">
|
| 10 |
+
<block type="GluuOxd_Openid/GluuOxOpenidConfig" name="test" template="gluuoxd_openid/login.phtml" />
|
|
|
|
| 11 |
</reference>
|
| 12 |
</adminhtml_index_login>
|
| 13 |
</layout>
|
app/design/adminhtml/default/default/template/gluuoxd_openid/gluuOxOpenidConfig.phtml
CHANGED
|
@@ -230,6 +230,9 @@ if (!$iconCustomColor) $iconCustomColor = '#0000FF';
|
|
| 230 |
} else {
|
| 231 |
jQuery("#no_apps_text").show();
|
| 232 |
}
|
|
|
|
|
|
|
|
|
|
| 233 |
}
|
| 234 |
var selectedApps = [];
|
| 235 |
function setTheme() {
|
|
@@ -477,7 +480,7 @@ if (!$iconCustomColor) $iconCustomColor = '#0000FF';
|
|
| 477 |
</div>
|
| 478 |
</div>
|
| 479 |
</div>
|
| 480 |
-
<div class="entry-edit" style="width: 1000px !important; margin-left: 30px
|
| 481 |
<div class="entry-edit-head" style="background-color: #00aa00 !important;">
|
| 482 |
<h4 class="icon-head head-edit-form fieldset-legend">Add scopes</h4>
|
| 483 |
</div>
|
|
@@ -811,7 +814,7 @@ if (!$iconCustomColor) $iconCustomColor = '#0000FF';
|
|
| 811 |
<p><img style="width: 100%; height: 100%;" src="https://raw.githubusercontent.com/GluuFederation/gluu-magento-sso-login-extension/master/plugin.png" alt="image"></p>
|
| 812 |
<p>Magento-GLUU-SSO extension gives access for login to your Magento site, with the help of GLUU server.</p>
|
| 813 |
<p>There are already 2 versions of Magento-GLUU-SSO (2.4.2.0 and 2.4.3.0) extensions, each in its turn is working with oxD and GLUU servers.
|
| 814 |
-
For example if you are using Magento-gluu-sso-2.4.
|
| 815 |
<p>Now I want to explain in details how to use extension step by step.</p>
|
| 816 |
<p>Extension will not be working if your host does not have https://.</p>
|
| 817 |
<h2><a id="Step_1_Install_Gluuserver_13"></a>Step 1. Install Gluu-server</h2>
|
|
@@ -819,7 +822,7 @@ if (!$iconCustomColor) $iconCustomColor = '#0000FF';
|
|
| 819 |
<p>If you want to use external gluu server, You can not do this step.</p>
|
| 820 |
<p><a target="_blank" href="https://www.gluu.org/docs/deployment/">Gluu-server installation gide</a>.</p>
|
| 821 |
<h2><a id="Step_2_Download_oxDserver_21"></a>Step 2. Download oxD-server</h2>
|
| 822 |
-
<p><a target="_blank" href="https://ox.gluu.org/maven/org/xdi/oxd-server/2.4.
|
| 823 |
<h2><a id="Step_3_Unzip_and_run_oXDserver_31"></a>Step 3. Unzip and run oXD-server</h2>
|
| 824 |
<ol>
|
| 825 |
<li>Unzip your oxD-server.</li>
|
|
@@ -844,13 +847,13 @@ if (!$iconCustomColor) $iconCustomColor = '#0000FF';
|
|
| 844 |
<p>For making sure go to your gluu server / OpenID Connect / Clients and search for your oxD ID</p>
|
| 845 |
<p>If you want to reset configurations click on Reset configurations button.</p>
|
| 846 |
<h2><a id="Step_8_OpenID_Connect_Configuration_89"></a>Step 5. OpenID Connect Configuration</h2>
|
| 847 |
-
<p>OpenID Connect Configuration page for Magento-gluu-sso 2.4.
|
| 848 |
<h3><a id="Scopes_93"></a>Scopes.</h3>
|
| 849 |
<p>You can look all scopes in your gluu server / OpenID Connect / Scopes and understand the meaning of every scope.
|
| 850 |
Scopes are need for getting loged in users information from gluu server.
|
| 851 |
Pay attention to that, which scopes you are using that are switched on in your gluu server.</p>
|
| 852 |
-
<p>In Magento-gluu-sso 2.4.
|
| 853 |
-
<img style="width: 100%; height: 100%;" src="https://raw.githubusercontent.com/GluuFederation/gluu-magento-sso-login-extension/master/docu/
|
| 854 |
<h3><a id="Custom_scripts_104"></a>Custom scripts.</h3>
|
| 855 |
<p><img style="width: 100%; height: 100%;" src="https://raw.githubusercontent.com/GluuFederation/gluu-magento-sso-login-extension/master/docu/m5.png" alt="Customscripts"></p>
|
| 856 |
<p>You can look all custom scripts in your gluu server / Configuration / Manage Custom Scripts / and enable login type, which type you want.
|
| 230 |
} else {
|
| 231 |
jQuery("#no_apps_text").show();
|
| 232 |
}
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
|
| 236 |
}
|
| 237 |
var selectedApps = [];
|
| 238 |
function setTheme() {
|
| 480 |
</div>
|
| 481 |
</div>
|
| 482 |
</div>
|
| 483 |
+
<div class="entry-edit" style="width: 1000px !important; margin-left: 30px">
|
| 484 |
<div class="entry-edit-head" style="background-color: #00aa00 !important;">
|
| 485 |
<h4 class="icon-head head-edit-form fieldset-legend">Add scopes</h4>
|
| 486 |
</div>
|
| 814 |
<p><img style="width: 100%; height: 100%;" src="https://raw.githubusercontent.com/GluuFederation/gluu-magento-sso-login-extension/master/plugin.png" alt="image"></p>
|
| 815 |
<p>Magento-GLUU-SSO extension gives access for login to your Magento site, with the help of GLUU server.</p>
|
| 816 |
<p>There are already 2 versions of Magento-GLUU-SSO (2.4.2.0 and 2.4.3.0) extensions, each in its turn is working with oxD and GLUU servers.
|
| 817 |
+
For example if you are using Magento-gluu-sso-2.4.3.0 extension, you need to connect with oxD-server-2.4.2.</p>
|
| 818 |
<p>Now I want to explain in details how to use extension step by step.</p>
|
| 819 |
<p>Extension will not be working if your host does not have https://.</p>
|
| 820 |
<h2><a id="Step_1_Install_Gluuserver_13"></a>Step 1. Install Gluu-server</h2>
|
| 822 |
<p>If you want to use external gluu server, You can not do this step.</p>
|
| 823 |
<p><a target="_blank" href="https://www.gluu.org/docs/deployment/">Gluu-server installation gide</a>.</p>
|
| 824 |
<h2><a id="Step_2_Download_oxDserver_21"></a>Step 2. Download oxD-server</h2>
|
| 825 |
+
<p><a target="_blank" href="https://ox.gluu.org/maven/org/xdi/oxd-server/2.4.3.Final/oxd-server-2.4.3.Final-distribution.zip">Download oxD-server-2.4.3.Final</a>.</p>
|
| 826 |
<h2><a id="Step_3_Unzip_and_run_oXDserver_31"></a>Step 3. Unzip and run oXD-server</h2>
|
| 827 |
<ol>
|
| 828 |
<li>Unzip your oxD-server.</li>
|
| 847 |
<p>For making sure go to your gluu server / OpenID Connect / Clients and search for your oxD ID</p>
|
| 848 |
<p>If you want to reset configurations click on Reset configurations button.</p>
|
| 849 |
<h2><a id="Step_8_OpenID_Connect_Configuration_89"></a>Step 5. OpenID Connect Configuration</h2>
|
| 850 |
+
<p>OpenID Connect Configuration page for Magento-gluu-sso 2.4.3.0.</p>
|
| 851 |
<h3><a id="Scopes_93"></a>Scopes.</h3>
|
| 852 |
<p>You can look all scopes in your gluu server / OpenID Connect / Scopes and understand the meaning of every scope.
|
| 853 |
Scopes are need for getting loged in users information from gluu server.
|
| 854 |
Pay attention to that, which scopes you are using that are switched on in your gluu server.</p>
|
| 855 |
+
<p>In Magento-gluu-sso 2.4.3.0 you can add, enable, disable and delete scope.
|
| 856 |
+
<img style="width: 100%; height: 100%;" src="https://raw.githubusercontent.com/GluuFederation/gluu-magento-sso-login-extension/master/docu/m4.png" alt="Scopes1"></p>
|
| 857 |
<h3><a id="Custom_scripts_104"></a>Custom scripts.</h3>
|
| 858 |
<p><img style="width: 100%; height: 100%;" src="https://raw.githubusercontent.com/GluuFederation/gluu-magento-sso-login-extension/master/docu/m5.png" alt="Customscripts"></p>
|
| 859 |
<p>You can look all custom scripts in your gluu server / Configuration / Manage Custom Scripts / and enable login type, which type you want.
|
app/design/adminhtml/default/default/template/gluuoxd_openid/login.phtml
CHANGED
|
@@ -1,207 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<?php
|
| 2 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
?>
|
| 4 |
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
| 5 |
-
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
| 6 |
-
<head>
|
| 7 |
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
| 8 |
-
<title><?php echo Mage::helper('adminhtml')->__('Log into Magento Admin Page') ?></title>
|
| 9 |
-
<link type="text/css" rel="stylesheet" href="<?php echo $this->getSkinUrl('reset.css') ?>" media="all" />
|
| 10 |
-
<link type="text/css" rel="stylesheet" href="<?php echo $this->getSkinUrl('boxes.css') ?>" media="all" />
|
| 11 |
-
<link rel="icon" href="<?php echo $this->getSkinUrl('favicon.ico') ?>" type="image/x-icon" />
|
| 12 |
-
<link rel="shortcut icon" href="<?php echo $this->getSkinUrl('favicon.ico') ?>" type="image/x-icon" />
|
| 13 |
|
| 14 |
-
<script type="text/javascript" src="<?php echo $this->getJsUrl('prototype/prototype.js') ?>"></script>
|
| 15 |
-
<script type="text/javascript" src="<?php echo $this->getJsUrl('prototype/validation.js') ?>"></script>
|
| 16 |
-
<script type="text/javascript" src="<?php echo $this->getJsUrl('scriptaculous/effects.js') ?>"></script>
|
| 17 |
-
<script type="text/javascript" src="<?php echo $this->getJsUrl('mage/adminhtml/form.js') ?>"></script>
|
| 18 |
-
<script type="text/javascript" src="<?php echo $this->getJsUrl('mage/captcha.js') ?>"></script>
|
| 19 |
|
| 20 |
-
|
| 21 |
-
<!--[if lt IE 7]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('below_ie7.css') ?>" type="text/css" media="all" /> <![endif]-->
|
| 22 |
-
<!--[if IE 7]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('ie7.css') ?>" type="text/css" media="all" /> <![endif]-->
|
| 23 |
-
</head>
|
| 24 |
-
<body id="page-login" onload="document.forms.loginForm.username.focus();">
|
| 25 |
-
<div class="login-container">
|
| 26 |
-
<div class="login-box">
|
| 27 |
-
<form method="post" action="" id="loginForm" autocomplete="off">
|
| 28 |
-
<div class="login-form">
|
| 29 |
-
<input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
|
| 30 |
-
<h2><?php echo Mage::helper('adminhtml')->__('Log in to Admin Panel') ?></h2>
|
| 31 |
-
<div id="messages">
|
| 32 |
-
<?php echo $this->getMessagesBlock()->toHtml() ?>
|
| 33 |
-
</div>
|
| 34 |
-
<div class="input-box input-left"><label for="username"><?php echo Mage::helper('adminhtml')->__('User Name:') ?></label><br/>
|
| 35 |
-
<input type="text" id="username" name="login[username]" value="" class="required-entry input-text" /></div>
|
| 36 |
-
<div class="input-box input-right"><label for="login"><?php echo Mage::helper('adminhtml')->__('Password:') ?></label><br />
|
| 37 |
-
<!-- This is a dummy hidden field to trick firefox from auto filling the password -->
|
| 38 |
-
<input type="text" class="input-text no-display" name="dummy" id="dummy" />
|
| 39 |
-
<input type="password" id="login" name="login[password]" class="required-entry input-text" value="" /></div>
|
| 40 |
-
<?php echo $this->getChildHtml('form.additional.info'); ?>
|
| 41 |
-
<div class="clear"></div>
|
| 42 |
-
<div class="form-buttons">
|
| 43 |
-
<a class="left" href="<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/index/forgotpassword', array('_nosecret' => true)) ?>"><?php echo Mage::helper('adminhtml')->__('Forgot your password?') ?></a>
|
| 44 |
-
<input type="submit" class="form-button" value="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('adminhtml')->__('Login')) ?>" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('adminhtml')->__('Login')) ?>" />
|
| 45 |
-
</div>
|
| 46 |
-
<?php
|
| 47 |
-
if(Mage::getSingleton('admin/session')->isLoggedIn()) {
|
| 48 |
-
$customer = Mage::getSingleton('admin/session')->getUser();
|
| 49 |
-
?>
|
| 50 |
-
<script type="application/javascript">
|
| 51 |
-
location.reload();
|
| 52 |
-
</script>
|
| 53 |
-
<?php
|
| 54 |
-
}
|
| 55 |
-
$oxd_id = Mage::getStoreConfig('gluu/oxd/oxd_id');
|
| 56 |
|
| 57 |
-
|
| 58 |
-
?>
|
| 59 |
-
<style type="text/css">
|
| 60 |
-
.gluuox_login_icon_preview{
|
| 61 |
-
width:35px;
|
| 62 |
-
cursor:pointer;
|
| 63 |
-
display:inline;
|
| 64 |
-
}
|
| 65 |
-
.customer-account-login .page-title{
|
| 66 |
-
margin-top: -100px !important;
|
| 67 |
-
}
|
| 68 |
-
</style>
|
| 69 |
-
<link href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/GluuOxd_Openid/css/bootstrap-social.css'; ?>" rel="stylesheet">
|
| 70 |
-
<link href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/GluuOxd_Openid/css/font-awesome.min.css'; ?>" rel="stylesheet">
|
| 71 |
-
<div id="messages">
|
| 72 |
-
<ul class="mini-messages">
|
| 73 |
-
<?php if(Mage::getSingleton('core/session')->getErrorMessage()){?>
|
| 74 |
-
<li class="error-msg"><ul><li><span><?php echo Mage::getSingleton('core/session')->getErrorMessage(); ?></span><a id="error-cancel" href="#">×</a></li></ul></li>
|
| 75 |
-
<?php }?>
|
| 76 |
-
<?php if(Mage::getSingleton('core/session')->getSuccessMessage()){?>
|
| 77 |
-
<li class="success-msg"><ul><li><span><?php echo Mage::getSingleton('core/session')->getSuccessMessage(); ?></span><a id="success-cancel" href="#">×</a></li></ul></li>
|
| 78 |
-
<?php }?>
|
| 79 |
-
</ul>
|
| 80 |
-
</div>
|
| 81 |
|
|
|
|
| 82 |
<?php
|
| 83 |
-
|
| 84 |
-
$
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
return Mage::helper('GluuOxd_Openid')->getConfig($data);
|
| 91 |
-
}
|
| 92 |
-
function getOpenIdAdminUrl(){
|
| 93 |
-
return Mage::helper("adminhtml")->getUrl("*/index/index");
|
| 94 |
}
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
$iconCustomSize = getConfigForAdmin('iconCustomSize');
|
| 98 |
-
if(!$iconCustomSize) $iconCustomSize = '35';
|
| 99 |
-
$iconCustomWidth = getConfigForAdmin('iconCustomWidth');
|
| 100 |
-
if(!$iconCustomWidth) $iconCustomWidth = '200';
|
| 101 |
-
$iconCustomHeight = getConfigForAdmin('iconCustomHeight');
|
| 102 |
-
if(!$iconCustomHeight) $iconCustomHeight = '35';
|
| 103 |
-
$loginCustomTheme = getConfigForAdmin('loginCustomTheme');
|
| 104 |
-
$loginTheme = getConfigForAdmin('loginTheme');
|
| 105 |
-
$iconCustomColor = getConfigForAdmin('iconCustomColor');
|
| 106 |
-
if(!$iconCustomColor) $iconCustomColor = '#0000FF';
|
| 107 |
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
}
|
| 113 |
?>
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
$paddingLong = 0;
|
| 118 |
-
if($iconCustomHeight>26)
|
| 119 |
-
$paddingLong = ($iconCustomHeight-26)/2;
|
| 120 |
-
if($loginCustomTheme=='custom') { ?>
|
| 121 |
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
<?php }
|
| 132 |
-
}
|
| 133 |
-
?>
|
| 134 |
-
</center></div>
|
| 135 |
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
?>
|
| 142 |
-
<a id="gluuox_login_button_preview_<?php echo $enabled['value'];?>" class="btn btn-block btn-defaulttheme btn-social btn-<?php echo $enabled['value'];?> btn-custom-size" style="width: <?php echo $iconCustomWidth;?>px; height:<?php echo $iconCustomHeight;?>px; padding-top: <?php echo $paddingLong;?>px; padding-bottom: <?php echo $paddingLong;?>px; margin-bottom: <?php echo $iconSpace.'px'; ?>" onclick="socialLogin('<?php echo $enabled['value'];?>')" >
|
| 143 |
-
<i class="fa fa-<?php echo $enabled['value'];?>-plus" style="padding-top: 0px;"></i>Login with <?php echo $enabled['name'];?></a>
|
| 144 |
-
<?php }
|
| 145 |
-
}
|
| 146 |
-
?>
|
| 147 |
-
</center></div>
|
| 148 |
-
<?php } ?>
|
| 149 |
-
|
| 150 |
-
<?php }
|
| 151 |
-
else {
|
| 152 |
?>
|
| 153 |
-
<style
|
| 154 |
-
<?php
|
| 155 |
-
if($loginTheme=='circle'){ ?>
|
| 156 |
-
<style> .gluuox_login_icon_preview, .gluuOx_custom_login_icon_preview{border-radius: 999px !important;}</style>
|
| 157 |
-
<?php } else if($loginTheme=='oval'){ ?>
|
| 158 |
-
<style> .gluuox_login_icon_preview, .gluuOx_custom_login_icon_preview{border-radius: 5px !important;}</style>
|
| 159 |
-
<?php }
|
| 160 |
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
foreach($enableds as $enabled){
|
| 165 |
-
if($enabled['enable']){
|
| 166 |
-
?>
|
| 167 |
-
<i class="gluuOx_custom_login_icon_preview fa fa-<?php echo $enabled['value'];?>-plus" id="gluuOx_custom_login_icon_preview_<?php echo $enabled['value'];?>" style="color: rgb(255, 255, 255); text-align: center; margin-top: 5px; height: <?php echo $iconCustomSize;?>px; width: <?php echo $iconCustomSize;?>px; padding-top: 8px; margin-left: <?php echo $iconSpace.'px'; ?>; font-size: <?php echo $iconCustomSize-16;?>px; background: <?php echo $iconCustomColor;?>;" onclick="socialLogin('<?php echo $enabled['value'];?>')" ></i>
|
| 168 |
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
<img class="gluuox_login_icon_preview" id="gluuox_login_icon_preview_<?php echo $enabled['value'];?>" src="<?php echo $enabled['image']; ?>"
|
| 180 |
-
style="margin-left: <?php echo $iconSpace.'px'; ?>; height:<?php echo $iconCustomSize;?>px; width:<?php echo $iconCustomSize;?>px;" onclick="socialLogin('<?php echo $enabled['value'];?>')" />
|
| 181 |
|
| 182 |
-
<?php }
|
| 183 |
-
}
|
| 184 |
-
?>
|
| 185 |
-
</div>
|
| 186 |
<?php }
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
|
|
|
|
|
|
| 190 |
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
}
|
| 194 |
-
</script>
|
| 195 |
-
<?php }?>
|
| 196 |
-
</div>
|
| 197 |
-
<p class="legal"><?php echo Mage::helper('adminhtml')->__('Magento is a trademark of Magento Inc. Copyright © %s Magento Inc.', date('Y')) ?></p>
|
| 198 |
-
</form>
|
| 199 |
-
<div class="bottom"></div>
|
| 200 |
-
<script type="text/javascript">
|
| 201 |
-
var loginForm = new varienForm('loginForm');
|
| 202 |
-
</script>
|
| 203 |
-
</div>
|
| 204 |
-
</div>
|
| 205 |
-
</body>
|
| 206 |
-
</html>
|
| 207 |
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php $this->gluuoxd_openid_login_validate(); ?>
|
| 2 |
+
<style>
|
| 3 |
+
.gluuox_login_icon_preview{
|
| 4 |
+
width:35px;
|
| 5 |
+
cursor:pointer;
|
| 6 |
+
}
|
| 7 |
+
</style>
|
| 8 |
+
<link href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/GluuOxd_Openid/css/bootstrap-social.css'; ?>" rel="stylesheet">
|
| 9 |
+
<link href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/GluuOxd_Openid/css/font-awesome.min.css'; ?>" rel="stylesheet">
|
| 10 |
+
|
| 11 |
+
<div id="messages">
|
| 12 |
+
<ul class="mini-messages">
|
| 13 |
+
<?php if(Mage::getSingleton('core/session')->getErrorMessage()){?>
|
| 14 |
+
<li class="error-msg"><ul><li><span><?php echo Mage::getSingleton('core/session')->getErrorMessage(); ?></span><a id="error-cancel" href="#">×</a></li></ul></li>
|
| 15 |
+
<?php }?>
|
| 16 |
+
<?php if(Mage::getSingleton('core/session')->getSuccessMessage()){?>
|
| 17 |
+
<li class="success-msg"><ul><li><span><?php echo Mage::getSingleton('core/session')->getSuccessMessage(); ?></span><a id="success-cancel" href="#">×</a></li></ul></li>
|
| 18 |
+
<?php }?>
|
| 19 |
+
</ul>
|
| 20 |
+
</div>
|
| 21 |
+
|
| 22 |
<?php
|
| 23 |
+
$iconSpace = $this->getOpendIdConfig('iconSpace');
|
| 24 |
+
if(!$iconSpace) $iconSpace = '4';
|
| 25 |
+
$iconCustomSize = $this->getOpendIdConfig('iconCustomSize');
|
| 26 |
+
if(!$iconCustomSize) $iconCustomSize = '35';
|
| 27 |
+
$iconCustomWidth = $this->getOpendIdConfig('iconCustomWidth');
|
| 28 |
+
if(!$iconCustomWidth) $iconCustomWidth = '200';
|
| 29 |
+
$iconCustomHeight = $this->getOpendIdConfig('iconCustomHeight');
|
| 30 |
+
if(!$iconCustomHeight) $iconCustomHeight = '35';
|
| 31 |
+
$loginCustomTheme = $this->getOpendIdConfig('loginCustomTheme');
|
| 32 |
+
$loginTheme = $this->getOpendIdConfig('loginTheme');
|
| 33 |
+
$iconCustomColor = $this->getOpendIdConfig('iconCustomColor');
|
| 34 |
+
if(!$iconCustomColor) $iconCustomColor = '#0000FF';
|
| 35 |
+
$enableds = array();
|
| 36 |
+
$custom_scripts = unserialize(Mage::getStoreConfig ( 'gluu/oxd/oxd_openid_custom_scripts' ));
|
| 37 |
+
foreach($custom_scripts as $custom_script){
|
| 38 |
+
$enableds[] = array('enable'=>$this->getOpendIdConfig($custom_script['value'].'Enable'), 'value'=>$custom_script['value'], 'name'=>$custom_script['name'], 'image'=>$custom_script['image']);
|
| 39 |
+
}
|
| 40 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
<?php if($loginTheme=='longbutton') {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
+
if($loginCustomTheme=='custom') { ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
<div><center><br><br><br>
|
| 48 |
<?php
|
| 49 |
+
foreach($enableds as $enabled){
|
| 50 |
+
if($enabled['enable']){
|
| 51 |
+
?>
|
| 52 |
+
<a id="gluuOx_custom_login_button_preview_<?php echo $enabled['value'];?>" class="btn btn-block btn-customtheme btn-social btn-custom-size" style="width:<?php echo $iconCustomWidth;?>px;height:<?php echo $iconCustomHeight;?>px;padding-top: 6px;padding-bottom: 6px;margin-bottom:<?php echo $iconSpace;?>px;background:<?php echo $iconCustomColor;?>" onclick="socialLogin('<?php echo $enabled['value'];?>')" >
|
| 53 |
+
<i class="fa fa-<?php echo $enabled['value'];?>-plus"></i>Login with <?php echo $enabled['name'];?>
|
| 54 |
+
</a>
|
| 55 |
+
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
}
|
| 57 |
+
?>
|
| 58 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
+
<?php } else { ?>
|
| 61 |
+
<div>
|
| 62 |
+
<center><br><br><br>
|
| 63 |
+
<?php
|
| 64 |
+
foreach($enableds as $enabled){
|
| 65 |
+
if($enabled['enable']){
|
| 66 |
+
?>
|
| 67 |
+
<a id="gluuox_login_button_preview_<?php echo $enabled['value'];?>" class="btn btn-block btn-defaulttheme btn-social btn-<?php echo $enabled['value'];?> btn-custom-size" style="width: <?php echo $iconCustomWidth;?>px; height:<?php echo $iconCustomHeight;?>px; padding-top: 6px; padding-bottom: 6px; margin-bottom: <?php echo $iconSpace.'px'; ?>" onclick="socialLogin('<?php echo $enabled['value'];?>')" >
|
| 68 |
+
<i class="fa fa-<?php echo $enabled['value'];?>-plus" style="padding-top: 0px;"></i>Login with <?php echo $enabled['name'];?>
|
| 69 |
+
</a>
|
| 70 |
+
<?php }
|
| 71 |
}
|
| 72 |
?>
|
| 73 |
+
</center>
|
| 74 |
+
</div>
|
| 75 |
+
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
+
<?php } else {
|
| 78 |
+
?>
|
| 79 |
+
<style>.gluuOx_custom_login_icon_preview{cursor:pointer;}</style>
|
| 80 |
+
<?php
|
| 81 |
+
if($loginTheme=='circle'){ ?>
|
| 82 |
+
<style> .gluuox_login_icon_preview, .gluuOx_custom_login_icon_preview{border-radius: 999px !important;}</style>
|
| 83 |
+
<?php } else if($loginTheme=='oval'){ ?>
|
| 84 |
+
<style> .gluuox_login_icon_preview, .gluuOx_custom_login_icon_preview{border-radius: 5px !important;}</style>
|
| 85 |
+
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
+
if($loginCustomTheme=='custom') { ?>
|
| 88 |
+
<div>
|
| 89 |
+
<?php
|
| 90 |
+
foreach($enableds as $enabled){
|
| 91 |
+
if($enabled['enable']){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
?>
|
| 93 |
+
<i class="gluuOx_custom_login_icon_preview fa fa-<?php echo $enabled['value'];?>-plus" id="gluuOx_custom_login_icon_preview_<?php echo $enabled['value'];?>" style="color: rgb(255, 255, 255); text-align: center; margin-top: 5px; height: <?php echo $iconCustomSize-8;?>px; width: <?php echo $iconCustomSize;?>px; padding-top: 8px; margin-left: <?php echo $iconSpace.'px'; ?>; font-size: <?php echo $iconCustomSize-16;?>px; background: <?php echo $iconCustomColor;?>" onclick="socialLogin('<?php echo $enabled['value'];?>')" ></i>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
+
<?php }
|
| 96 |
+
}
|
| 97 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
+
</div>
|
| 100 |
+
<?php } else { ?>
|
| 101 |
+
<div style="margin-top:60px">
|
| 102 |
+
<?php
|
| 103 |
+
foreach($enableds as $enabled){
|
| 104 |
+
if($enabled['enable']){
|
| 105 |
+
?>
|
| 106 |
+
<img class="gluuox_login_icon_preview" id="gluuox_login_icon_preview_<?php echo $enabled['value'];?>" src="<?php echo $enabled['image']; ?>"
|
| 107 |
+
style="margin-left: <?php echo $iconSpace.'px'; ?>; height:<?php echo $iconCustomSize;?>px; width:<?php echo $iconCustomSize;?>px;" onclick="socialLogin('<?php echo $enabled['value'];?>')" />
|
| 108 |
+
<i class="gluuOx_custom_login_icon_preview fa fa-<?php echo $enabled['value'];?>-plus" id="gluuOx_custom_login_icon_preview_<?php echo $enabled['value'];?>" style="color: rgb(255, 255, 255); text-align: center; margin-top: 5px; height: <?php echo $iconCustomSize-8;?>px; width: <?php echo $iconCustomSize;?>px; padding-top: 8px; margin-left: <?php echo $iconSpace.'px'; ?>; font-size: <?php echo $iconCustomSize-16;?>px; background: <?php echo $iconCustomColor;?>" onclick="socialLogin('<?php echo $enabled['value'];?>')" ></i>
|
|
|
|
|
|
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
<?php }
|
| 111 |
+
}
|
| 112 |
+
?>
|
| 113 |
+
</div>
|
| 114 |
+
<?php }
|
| 115 |
+
} ?>
|
| 116 |
|
| 117 |
+
<script>
|
| 118 |
+
var baseUrl = '<?php echo $this->getOpenIdAdminUrl(); ?>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
+
function socialLogin(appName){
|
| 121 |
+
window.location.href = window.location + '?option=getMoSocialLogin&app_name='+appName;
|
| 122 |
+
}
|
| 123 |
+
</script>
|
app/design/frontend/base/default/template/gluuoxd_openid/homepage.phtml
CHANGED
|
@@ -153,4 +153,4 @@ if($oxd_id){
|
|
| 153 |
window.location.href = window.location + '?option=userGluuLogin&app_name='+appName;
|
| 154 |
}
|
| 155 |
</script>
|
| 156 |
-
<?php }
|
| 153 |
window.location.href = window.location + '?option=userGluuLogin&app_name='+appName;
|
| 154 |
}
|
| 155 |
</script>
|
| 156 |
+
<?php }
|
app/etc/modules/GluuOxd_Openid.xml
CHANGED
|
@@ -36,6 +36,28 @@
|
|
| 36 |
</GluuOxd_Openid>
|
| 37 |
</routers>
|
| 38 |
</admin>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
<global>
|
| 40 |
<blocks>
|
| 41 |
<GluuOxd_Openid>
|
| 36 |
</GluuOxd_Openid>
|
| 37 |
</routers>
|
| 38 |
</admin>
|
| 39 |
+
<adminhtml>
|
| 40 |
+
<layout>
|
| 41 |
+
<updates>
|
| 42 |
+
<GluuOxd_Openid_admin_layout>
|
| 43 |
+
<file>GluuOxd_Openid.xml</file>
|
| 44 |
+
</GluuOxd_Openid_admin_layout>
|
| 45 |
+
</updates>
|
| 46 |
+
</layout>
|
| 47 |
+
<menu>
|
| 48 |
+
<GluuOxdOpenid translate="title" module="GluuOxd_Openid">
|
| 49 |
+
<title>Gluu SSO</title>
|
| 50 |
+
<sort_order>81</sort_order>
|
| 51 |
+
<children>
|
| 52 |
+
<configure_extension translate="title" module="GluuOxd_Openid">
|
| 53 |
+
<title>Gluu and Social Login </title>
|
| 54 |
+
<sort_order>1</sort_order>
|
| 55 |
+
<action>openid/adminhtml_index</action>
|
| 56 |
+
</configure_extension>
|
| 57 |
+
</children>
|
| 58 |
+
</GluuOxdOpenid>
|
| 59 |
+
</menu>
|
| 60 |
+
</adminhtml>
|
| 61 |
<global>
|
| 62 |
<blocks>
|
| 63 |
<GluuOxd_Openid>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Magento_gluu_SSO</name>
|
| 4 |
-
<version>2.4.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="https://github.com/GluuFederation/gluu-sso-login-magento-extension/blob/master/LICENSE">Gluu inc.</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -11,8 +11,8 @@
|
|
| 11 |
<notes>Use OpenID Connect to login by leveraging the oxd client service demon.</notes>
|
| 12 |
<authors><author><name>Vlad</name><user>MAG003268474</user><email>vlad.karapetyan.1988@mail.ru</email></author></authors>
|
| 13 |
<date>2016-07-08</date>
|
| 14 |
-
<time>11:
|
| 15 |
-
<contents><target name="magecommunity"><dir name="GluuOxd"><dir name="Openid"><dir name="Block"><file name="GluuOxOpenidConfig.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.3.10</min><max>7.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Magento_gluu_SSO</name>
|
| 4 |
+
<version>2.4.3</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="https://github.com/GluuFederation/gluu-sso-login-magento-extension/blob/master/LICENSE">Gluu inc.</license>
|
| 7 |
<channel>community</channel>
|
| 11 |
<notes>Use OpenID Connect to login by leveraging the oxd client service demon.</notes>
|
| 12 |
<authors><author><name>Vlad</name><user>MAG003268474</user><email>vlad.karapetyan.1988@mail.ru</email></author></authors>
|
| 13 |
<date>2016-07-08</date>
|
| 14 |
+
<time>11:34:51</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="GluuOxd"><dir name="Openid"><dir name="Block"><file name="GluuOxOpenidConfig.php" hash="c195bd43e7fae62cee6c2d606bc88c47"/></dir><dir name="Helper"><file name="ClientOXDRP.php" hash="dd8eae710af553a595e679557aa51a1d"/><file name="Data.php" hash="b071972c99d0ff572ee747ac74f52ea3"/><file name="GetAuthorizationUrl.php" hash="8ab714fd8a0d58e90258ca096682ab41"/><file name="GetTokensByCode.php" hash="573fa8969b272e2deed665a59a9246ab"/><file name="GetUserInfo.php" hash="c0414cf73d94cfc6f8b223c978515131"/><file name="Logout.php" hash="01190b453346f29eb46480235269938d"/><file name="RegisterSite.php" hash="7468c3814860731c41b7b74677b54603"/><file name="UpdateSiteRegistration.php" hash="46e5fb3cd205196e9de055dd3b122676"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="938783f73989703bbf5946b600605c9c"/><file name="LoginController.php" hash="8beee93a01a39ab0e35c040cfb276af7"/></dir><dir name="Customer"><file name="IndexController.php" hash="68d54ef62a5b6d67502cb937a4960b9e"/></dir></dir><dir name="etc"><file name="GluuOxd_module.xml" hash="5600de1dafe97bbe4c0f9665a05109af"/><file name="adminhtml.xml" hash="015d568a82751f5ac79406efc588189f"/><file name="config.xml" hash="234b5944eb1211246227fee1edc907aa"/></dir><dir name="sql"><dir name="GluuOxd_Openid_setup"><file name="mysql4-install-1.9.2.php" hash="2b999ab29e5f8547d5f5216c6b45f1db"/><file name="mysql4-upgrade-1.9.2-1.9.3.php" hash="c58d26278b7f4a259ce64c345a2c13b6"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="GluuOxd_Openid.xml" hash="b1430764671d2bdaed24af92b223dd1a"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="GluuOxd_Openid"><dir name="css"><file name="font-awesome.min.css" hash="0831cba6a670e405168b84aa20798347"/><file name="gluu-oxd-css.css" hash="baf9352605bfa5b1e517c4fd67956221"/></dir><dir name="js"><file name="scope-custom-script.js" hash="683fc864dadeef961dff5593278da9a9"/></dir><dir name="fonts"><file name="FontAwesome.otf" hash="668743fe7258676f8ef8f9b47d2a623e"/><file name="fontawesome-webfont.eot" hash="45c73723862c6fc5eb3d6961db2d71fb"/><file name="fontawesome-webfont.svg" hash="76a4f23c6be74fd309e0d0fd2c27a5de"/><file name="fontawesome-webfont.ttf" hash="7c87870ab40d63cfb8870c1f183f9939"/><file name="fontawesome-webfont.woff" hash="dfb02f8f6d0cedc009ee5887cc68f1f3"/><file name="fontawesome-webfont.woff2" hash="4b5a84aaf1c9485e060c503a0ff8cadb"/></dir><dir name="images"><file name="plugin.png" hash="25e24c91210b97f473a78ce61aaf9631"/><dir name="icons"><file name="basic.png" hash="6de404ccf013fa11a105a7001970d3c4"/><file name="duo.png" hash="a5d8604a0cefaaf40b11e1100bc3310f"/><file name="u2f.png" hash="2b6c8cda311412a8d2ec484121540e8a"/><file name="gl.png" hash="d8856c05eccc82c1e17b71fc64b81c34"/><file name="ox.png" hash="5e07d3eaa76c40c7bc032081071a5fc8"/><file name="google.png" hash="b4dea77020ed95bc53f7d27a52b925fa"/></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="GluuOxd_Openid_layout.xml" hash="5c781078b346fc6ee4b241eb36cffd2f"/></dir><dir name="template"><dir name="gluuoxd_openid"><file name="homepage.phtml" hash="925eb1f0e0e99029e2b23fac24c9d803"/><file name="logout.phtml" hash="34d85cad08e8628c9accf140be2c81b7"/><file name="homepage.phtml" hash="925eb1f0e0e99029e2b23fac24c9d803"/><file name="logout.phtml" hash="34d85cad08e8628c9accf140be2c81b7"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="gluuoxd_openid"><file name="gluuOxOpenidConfig.phtml" hash="cd91e9a5855c1ed35ed19b676b232f1e"/><file name="login.phtml" hash="9167f5448ce32db53773f22d1f885e80"/></dir></dir><dir name="layout"><file name="GluuOxd_Openid.xml" hash="40ef0ede9000825a377ee5ecb3c67442"/></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.3.10</min><max>7.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
