Changeset 2809905
- Timestamp:
- 11/02/2022 12:54:18 PM (3 years ago)
- Location:
- login-with-cognito
- Files:
-
- 6 edited
-
tags/1.4.7/class-mo-oauth-widget.php (modified) (1 diff)
-
tags/1.4.7/mo_oauth_settings.php (modified) (1 diff)
-
tags/1.4.7/readme.txt (modified) (2 diffs)
-
trunk/class-mo-oauth-widget.php (modified) (1 diff)
-
trunk/mo_oauth_settings.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
login-with-cognito/tags/1.4.7/class-mo-oauth-widget.php
r2746357 r2809905 371 371 } 372 372 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 */ 374 416 } 375 417 -
login-with-cognito/tags/1.4.7/mo_oauth_settings.php
r2746357 r2809905 4 4 * Plugin URI: miniorange-login-with-cognito 5 5 * 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. 76 * Version: 1.4.5 7 7 * Author: miniOrange 8 8 * Author URI: https://www.miniorange.com -
login-with-cognito/tags/1.4.7/readme.txt
r2746357 r2809905 1 1 === Login with Cognito === 2 Contributors: cyberlord92 2 Contributors: cyberlord92,oauth 3 3 Tags: cognito, aws, amazon, OAuth 2.0, SSO 4 4 Requires at least: 3.0.1 5 Tested up to: 6.06 Stable tag: 1.4. 75 Tested up to: 5.9 6 Stable tag: 1.4.5 7 7 License: MIT/Expat 8 8 License URI: https://docs.miniorange.com/mit-license … … 82 82 == Changelog == 83 83 84 = 1.4.7 =85 * Security fixes86 87 = 1.4.6 =88 * Added compatiblity with WP 6.089 90 84 = 1.4.5 = 91 85 * Added compatiblity with WP 5.9 -
login-with-cognito/trunk/class-mo-oauth-widget.php
r2746357 r2809905 371 371 } 372 372 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 */ 374 416 } 375 417 -
login-with-cognito/trunk/mo_oauth_settings.php
r2746357 r2809905 4 4 * Plugin URI: miniorange-login-with-cognito 5 5 * 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. 76 * Version: 1.4.5 7 7 * Author: miniOrange 8 8 * Author URI: https://www.miniorange.com -
login-with-cognito/trunk/readme.txt
r2746357 r2809905 1 1 === Login with Cognito === 2 Contributors: cyberlord92 2 Contributors: cyberlord92,oauth 3 3 Tags: cognito, aws, amazon, OAuth 2.0, SSO 4 4 Requires at least: 3.0.1 5 Tested up to: 6.06 Stable tag: 1.4. 75 Tested up to: 5.9 6 Stable tag: 1.4.5 7 7 License: MIT/Expat 8 8 License URI: https://docs.miniorange.com/mit-license … … 82 82 == Changelog == 83 83 84 = 1.4.7 =85 * Security fixes86 87 = 1.4.6 =88 * Added compatiblity with WP 6.089 90 84 = 1.4.5 = 91 85 * Added compatiblity with WP 5.9
Note: See TracChangeset
for help on using the changeset viewer.