私は2つのサーバー(つまり、異なるログインページを持つserver1とserver2)を持っています。2台の異なるサーバーの1回限りの認証方法は?
サーバー1
login_server1.php
<form method="post" action="$ACTION$">
<input name="auth_user" type="email">
<input name="auth_pass" type="password">
<input name="redirurl" type="hidden" value="$REDIRURL$">
<input name="accept" type="submit" value="Login">
</form>
だから、ログインエラーで、サーバー1に戻り
login_server1_error.php
<form method="post" action="$ACTION$">
<p class="login-error">$MESSAGE$</p>
<input name="auth_user" type="email">
<input name="auth_pass" type="password">
<input name="redirurl" type="hidden" value="$REDIRURL$">
<input name="accept" type="submit" value="Login">
</form>
サーバー2は、このサーバー上のURLにログインして、そのURLに移動するための自動認証を自動で行います。これはプロセスです
<?php
/*
AutoAuth Script
*/
# Define Server2 URL & AutoAuth Key
$server2url = "http://server2/dologin.php";
$autoauthkey = "abcXYZ123";
$timestamp = time(); # Get current timestamp
$email = "[email protected]"; # Clients Email Address to Login
$goto = "clientarea.php?action=products";
$hash = sha1($email.$timestamp.$autoauthkey); # Generate Hash
# Generate AutoAuth URL & Redirect
$url = $server2url."?email=$email×tamp=$timestamp&hash=$hash&goto=".urlencode($goto);
header("Location: $url");
exit;
?>
sever1フォームの送信アクションを実行すると、server2urlにアクセスする方法を教えてください。 のServer1最初のログインページで