0) { $db = new PDO("pgsql:host=localhost;port=5432;dbname=oidc_db;user=$dbUser;password=$dbPass"); $siteName = $_POST['siteName']; $redirectURL = $_POST['redirectURL']; $authMethod = $_POST['endpointAuth']; $notes = $_POST['notes']; $clientDN = $_SERVER['SSL_CLIENT_S_DN']; $cn_pos = strpos( $clientDN, ',CN=' ); $clientName = substr( $clientDN, $cn_pos + 4 ); $stmt = $db->query("select created_at from clients where site_name = '$siteName' and owner_id like '%$clientName%' and deleted_at is null"); $res = $stmt->fetch(PDO::FETCH_ASSOC); echo "
"; echo "Client ID"; echo " | "; echo ""; echo " | "; echo ""; echo $outArray['CLIENT ID']; echo " | "; echo "
"; echo "Client Secret"; echo " | "; echo ""; echo " | "; echo ""; echo $outArray['CLIENT SECRET']; echo " | "; echo "
"; echo "You will also need the following URLs for your site plugin."; echo "
"; echo ""; echo "Authorize"; echo " | "; echo ""; echo " | "; echo $ini_arr[ 'AuthURL' ]; echo " | "; echo "
"; echo "Token"; echo " | "; echo ""; echo " | "; echo $ini_arr[ 'TokenURL' ]; echo " | "; echo "
"; echo "User Info"; echo " | "; echo ""; echo " | "; echo $ini_arr[ 'UserInfoURL' ]; echo " | "; echo "
Download a list of relevant URLs here
"; $stmt = $db->prepare("insert into clients ( site_name, site_owner, client_id, owner_id, redirect_url ) values ( ?, ?, ?, ?, ? ) "); $clientID = $outArray['CLIENT ID']; $retcode = $stmt->execute([$siteName, $clientName, $clientID, $clientDN, $redirectURL]); $dbClientID = $db->lastInsertID(); $stmt = $db->prepare("insert into owner_email ( client_id, e_mail ) values ( ?, ? )"); foreach ($clientEMail as $mail) { $retcode = $stmt->execute([$dbClientID, $mail]); } } else { echo ""; echo "Unable to register new client."; echo "
"; } } } else { ?>
How to Register a New Site |
To make use of this system and register a site,
you need the following things:
You may download the various URLs provided by the OpenID component here |
|
Copyright © CAcert, Inc '; echo date("Y"); echo "
"; echo "