Plugin Directory

Changeset 2809905


Ignore:
Timestamp:
11/02/2022 12:54:18 PM (3 years ago)
Author:
yashyadav247
Message:

1.4.7 release

Location:
login-with-cognito
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • login-with-cognito/tags/1.4.7/class-mo-oauth-widget.php

    r2746357 r2809905  
    371371            }
    372372
    373         }
     373        } else if( isset( $_REQUEST['option'] ) and strpos( $_REQUEST['option'], 'generateDynmicUrl' ) !== false ) {
     374            $client_id = get_option('mo_oauth_' . $_REQUEST['app_name'] . '_client_id');
     375            $timestamp = round( microtime(true) * 1000 );
     376            $api_key = get_option('mo_oauth_admin_api_key');
     377            $token = $client_id . ':' . number_format($timestamp, 0, '', '') . ':' . $api_key;
     378
     379            $customer_token = get_option('customer_token');
     380            $method = 'AES-128-ECB';
     381            $ivSize = openssl_cipher_iv_length($method);
     382            $iv     = openssl_random_pseudo_bytes($ivSize);
     383            $token_params_encrypt = openssl_encrypt ($token, $method, $customer_token,OPENSSL_RAW_DATA||OPENSSL_ZERO_PADDING, $iv);
     384            $token_params_encode = base64_encode( $iv.$token_params_encrypt );
     385            $token_params = urlencode( $token_params_encode );
     386
     387            $return_url = urlencode( site_url() . '/?option=mooauth' );
     388            $url = get_option('host_name') . '/moas/oauth/client/authorize?token=' . $token_params . '&id=' . get_option('mo_oauth_admin_customer_key') . '&encrypted=true&app=' . $_REQUEST['app_name'] . '_oauth&returnurl=' . $return_url;
     389            wp_redirect( $url );
     390            exit;
     391        } else if( isset( $_REQUEST['option'] ) and strpos( $_REQUEST['option'], 'mooauth' ) !== false ){
     392
     393            //do stuff after returning from oAuth processing
     394            $access_token   = stripslashes( $_POST['access_token'] );
     395            $token_type     = stripslashes( $_POST['token_type'] );
     396            $user_email = '';
     397            if(array_key_exists('email', $_POST))
     398                $user_email     = sanitize_email( $_POST['email'] );
     399
     400
     401            if( $user_email ) {
     402                if( email_exists( $user_email ) ) { // user is a member
     403                      $user     = get_user_by('email', $user_email );
     404                      $user_id  = $user->ID;
     405                      wp_set_auth_cookie( $user_id, true );
     406                } else { // this user is a guest
     407                      $random_password  = wp_generate_password( 10, false );
     408                      $user_id          = wp_create_user( $user_email, $random_password, $user_email );
     409                      wp_set_auth_cookie( $user_id, true );
     410                }
     411            }
     412            wp_redirect( home_url() );
     413            exit;
     414        }
     415        /* End of old flow */
    374416    }
    375417
  • login-with-cognito/tags/1.4.7/mo_oauth_settings.php

    r2746357 r2809905  
    44* Plugin URI: miniorange-login-with-cognito
    55* Description: WordPress Login with Cognito plugin allows Login(Single Sign-On) to WordPress using AWS Cognito account credentials. You can SSO(Single Sign-on) to your WordPress site with Cognito using this plugin. This plugin uses OAuth protocol to achieve Single Sign-on.
    6 * Version: 1.4.7
     6* Version: 1.4.5
    77* Author: miniOrange
    88* Author URI: https://www.miniorange.com
  • login-with-cognito/tags/1.4.7/readme.txt

    r2746357 r2809905  
    11=== Login with Cognito ===
    2 Contributors: cyberlord92
     2Contributors: cyberlord92,oauth
    33Tags: cognito, aws, amazon, OAuth 2.0, SSO
    44Requires at least: 3.0.1
    5 Tested up to: 6.0
    6 Stable tag: 1.4.7
     5Tested up to: 5.9
     6Stable tag: 1.4.5
    77License: MIT/Expat
    88License URI: https://docs.miniorange.com/mit-license
     
    8282== Changelog ==
    8383
    84 = 1.4.7 =
    85 * Security fixes
    86 
    87 = 1.4.6 =
    88 * Added compatiblity with WP 6.0
    89 
    9084= 1.4.5 =
    9185* Added compatiblity with WP 5.9
  • login-with-cognito/trunk/class-mo-oauth-widget.php

    r2746357 r2809905  
    371371            }
    372372
    373         }
     373        } else if( isset( $_REQUEST['option'] ) and strpos( $_REQUEST['option'], 'generateDynmicUrl' ) !== false ) {
     374            $client_id = get_option('mo_oauth_' . $_REQUEST['app_name'] . '_client_id');
     375            $timestamp = round( microtime(true) * 1000 );
     376            $api_key = get_option('mo_oauth_admin_api_key');
     377            $token = $client_id . ':' . number_format($timestamp, 0, '', '') . ':' . $api_key;
     378
     379            $customer_token = get_option('customer_token');
     380            $method = 'AES-128-ECB';
     381            $ivSize = openssl_cipher_iv_length($method);
     382            $iv     = openssl_random_pseudo_bytes($ivSize);
     383            $token_params_encrypt = openssl_encrypt ($token, $method, $customer_token,OPENSSL_RAW_DATA||OPENSSL_ZERO_PADDING, $iv);
     384            $token_params_encode = base64_encode( $iv.$token_params_encrypt );
     385            $token_params = urlencode( $token_params_encode );
     386
     387            $return_url = urlencode( site_url() . '/?option=mooauth' );
     388            $url = get_option('host_name') . '/moas/oauth/client/authorize?token=' . $token_params . '&id=' . get_option('mo_oauth_admin_customer_key') . '&encrypted=true&app=' . $_REQUEST['app_name'] . '_oauth&returnurl=' . $return_url;
     389            wp_redirect( $url );
     390            exit;
     391        } else if( isset( $_REQUEST['option'] ) and strpos( $_REQUEST['option'], 'mooauth' ) !== false ){
     392
     393            //do stuff after returning from oAuth processing
     394            $access_token   = stripslashes( $_POST['access_token'] );
     395            $token_type     = stripslashes( $_POST['token_type'] );
     396            $user_email = '';
     397            if(array_key_exists('email', $_POST))
     398                $user_email     = sanitize_email( $_POST['email'] );
     399
     400
     401            if( $user_email ) {
     402                if( email_exists( $user_email ) ) { // user is a member
     403                      $user     = get_user_by('email', $user_email );
     404                      $user_id  = $user->ID;
     405                      wp_set_auth_cookie( $user_id, true );
     406                } else { // this user is a guest
     407                      $random_password  = wp_generate_password( 10, false );
     408                      $user_id          = wp_create_user( $user_email, $random_password, $user_email );
     409                      wp_set_auth_cookie( $user_id, true );
     410                }
     411            }
     412            wp_redirect( home_url() );
     413            exit;
     414        }
     415        /* End of old flow */
    374416    }
    375417
  • login-with-cognito/trunk/mo_oauth_settings.php

    r2746357 r2809905  
    44* Plugin URI: miniorange-login-with-cognito
    55* Description: WordPress Login with Cognito plugin allows Login(Single Sign-On) to WordPress using AWS Cognito account credentials. You can SSO(Single Sign-on) to your WordPress site with Cognito using this plugin. This plugin uses OAuth protocol to achieve Single Sign-on.
    6 * Version: 1.4.7
     6* Version: 1.4.5
    77* Author: miniOrange
    88* Author URI: https://www.miniorange.com
  • login-with-cognito/trunk/readme.txt

    r2746357 r2809905  
    11=== Login with Cognito ===
    2 Contributors: cyberlord92
     2Contributors: cyberlord92,oauth
    33Tags: cognito, aws, amazon, OAuth 2.0, SSO
    44Requires at least: 3.0.1
    5 Tested up to: 6.0
    6 Stable tag: 1.4.7
     5Tested up to: 5.9
     6Stable tag: 1.4.5
    77License: MIT/Expat
    88License URI: https://docs.miniorange.com/mit-license
     
    8282== Changelog ==
    8383
    84 = 1.4.7 =
    85 * Security fixes
    86 
    87 = 1.4.6 =
    88 * Added compatiblity with WP 6.0
    89 
    9084= 1.4.5 =
    9185* Added compatiblity with WP 5.9
Note: See TracChangeset for help on using the changeset viewer.