. , , :
, . :
.. , cookie/session, , , . / ââ /.
, , .
, . ( , ), cookie. cookie , , .
1: ,
, . , URL-, http://otherapplication.com/login?user=adomnom&pass=awesome ( ).
2: , ( )
, , , . , "" , . . .
, - , cookie, .
...
1. CakePHP:/get-token
GET, , .
2. / CakePHP, GET 'token'
'token' to/login , .
3. ,
, gform_confirmation. , (.. , ).
add_action( 'gform_confirmation_6', 'mysite_gform_confirmation', 10, 3 );
function mysite_gform_confirmation( $confirmation, $form, $entry ) {
$token = wp_remote_post(
'http://otherapplicationurl.com/login',
array(
'body' => array(
"data[User][username]" => $entry[1],
"data[User][password]" => $entry[2]
)
)
);
GFAPI::delete_entry( $entry['id'] );
return array('redirect', "http://otherapplicationurl.com/login?token=$token");
}
, ! !