<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://doc-en-mirror.openflyers.com/index.php?action=history&amp;feed=atom&amp;title=Identification-check-from-OpenFlyers-for-third-party-software</id>
	<title>Identification check from OpenFlyers for third party software - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://doc-en-mirror.openflyers.com/index.php?action=history&amp;feed=atom&amp;title=Identification-check-from-OpenFlyers-for-third-party-software"/>
	<link rel="alternate" type="text/html" href="https://doc-en-mirror.openflyers.com/index.php?title=Identification-check-from-OpenFlyers-for-third-party-software&amp;action=history"/>
	<updated>2026-05-01T09:24:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://doc-en-mirror.openflyers.com/index.php?title=Identification-check-from-OpenFlyers-for-third-party-software&amp;diff=307&amp;oldid=prev</id>
		<title>imported&gt;Claratte: Text replacement - &quot;&lt;php&gt;&quot; to &quot;&lt;syntaxhighlight lang=&quot;php&quot;&gt;&quot;</title>
		<link rel="alternate" type="text/html" href="https://doc-en-mirror.openflyers.com/index.php?title=Identification-check-from-OpenFlyers-for-third-party-software&amp;diff=307&amp;oldid=prev"/>
		<updated>2024-08-12T18:53:08Z</updated>

		<summary type="html">&lt;p&gt;Text replacement - &amp;quot;&amp;lt;php&amp;gt;&amp;quot; to &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
=Presentation=&lt;br /&gt;
Here is an presentation of how to check if an identification/password couple submitted by your own scripts is correct according to the OpenFlyers database.&lt;br /&gt;
&lt;br /&gt;
The script returns a value which indicate if the connexion with the given login/password has succeeded and it states. An OpenFlyers cookie is also sent to manage a user session on your website, using the user's OpenFlyer's account.&lt;br /&gt;
&lt;br /&gt;
=How it works=&lt;br /&gt;
If your OpenFlyers is located at http://openflyers.com/platform-name/ just post at http://openflyers.com/platform-name/checkIdent.php with login and rawPassword variables.&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' OpenFlyers release 2 or higher required a password hashed with MD5 (see the commented $postData line below in the PHP script).&lt;br /&gt;
&lt;br /&gt;
==Possible return values==&lt;br /&gt;
The script display return an answer code which should be one of this value:&lt;br /&gt;
*0: OK&lt;br /&gt;
*1: OK but several profile availables. OpenFlyers select automatically the best profile.&lt;br /&gt;
*2: outdate but authorized&lt;br /&gt;
*3: outdate but authorized with outdate profile&lt;br /&gt;
*4: outdate subscription, unauthorized&lt;br /&gt;
*5: bad Ident, unauthorized&lt;br /&gt;
*6: Banned (ip or login), unauthorized&lt;br /&gt;
*7: no Ident -&amp;gt; ask one&lt;br /&gt;
&lt;br /&gt;
We recommend you to consider 0-2 OK and 3-7 bad&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' you have to filter public access login (with no right) because for OF, it's a valid access !!!&lt;br /&gt;
&lt;br /&gt;
=JavaScript=&lt;br /&gt;
If you are using your own authenticate form, use javascript function submit_pwd() located into \javascript\submitPwd.js&lt;br /&gt;
&lt;br /&gt;
=PHP code example=&lt;br /&gt;
''Please replace '''platform-name''' with your OpenFlyers platform's name, replace '''your-login''' with your OpenFlyers login and '''your-password''' with your OpenFlyers password.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here an example how to send a post request with php :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;// PHP 5.6 is required&lt;br /&gt;
// OpenSSL 1.0.1 is required&lt;br /&gt;
function httpPostRequest($host, $path, $postData) {&lt;br /&gt;
    $result= &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    $request = &amp;quot;POST $path HTTP/1.1\n&amp;quot;.&lt;br /&gt;
    &amp;quot;Host: $host\n&amp;quot;.&lt;br /&gt;
    (isset($referer) ? &amp;quot;Referer: $referer\n&amp;quot; : &amp;quot;&amp;quot;).&lt;br /&gt;
    &amp;quot;Content-type: Application/x-www-form-urlencoded\n&amp;quot;.&lt;br /&gt;
    &amp;quot;Content-length: &amp;quot;.strlen($postData).&amp;quot;\n&amp;quot;.&lt;br /&gt;
    &amp;quot;Connection: close\n\n&amp;quot;.&lt;br /&gt;
    $postData.&amp;quot;\n&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    // Some debug informations:&lt;br /&gt;
    print(&amp;quot;&amp;lt;pre&amp;gt;Request:\n&amp;quot;.htmlentities($request).&amp;quot;&amp;lt;/pre&amp;gt;&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    if ($fp = fsockopen($host, 443, $errno, $errstr, 3)) {&lt;br /&gt;
        // Set cryptology method&lt;br /&gt;
        // @link http://php.net/manual/en/function.stream-socket-enable-crypto.php&lt;br /&gt;
        if (!defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {&lt;br /&gt;
            die('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT IS REQUIRED');&lt;br /&gt;
        }&lt;br /&gt;
        $cryptoMethod = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;&lt;br /&gt;
        // Activate encryption while authenticating&lt;br /&gt;
        stream_socket_enable_crypto($fp, true, $cryptoMethod);&lt;br /&gt;
        if (fputs($fp, $request)) {&lt;br /&gt;
            while(! feof($fp)) {&lt;br /&gt;
                $result.= fgets($fp, 128);&lt;br /&gt;
            }&lt;br /&gt;
            // Deactivate encryption once authenticating done&lt;br /&gt;
            stream_socket_enable_crypto($fp, false);&lt;br /&gt;
            fclose($fp);&lt;br /&gt;
            //print($result);&lt;br /&gt;
            return $result;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$postData   = 'login=jbond&amp;amp;rawPassword='.md5('007');&lt;br /&gt;
$rawContent = httpPostRequest('openflyers.com','https://openflyers.com/plateform-name/checkIdent.php',$postData);&lt;br /&gt;
&lt;br /&gt;
list($header, $content) = explode(&amp;quot;\r\n\r\n&amp;quot;, $rawContent, 2);&lt;br /&gt;
list($byteQty, $realContent, $dummy) = explode(&amp;quot;\r\n&amp;quot;, $content, 3);&lt;br /&gt;
&lt;br /&gt;
// the answer is in $realContent&amp;lt;/php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Joomla authentification plugin=&lt;br /&gt;
If you have a Joomla website and you want that Openflyers users could connect to your Joomla restricted access zone, you may add this plugin to have only one account database: Openflyers one.&lt;br /&gt;
You don't need to update Joomla user database, this plugin ask directly Openflyers thanks to CheckIdent.php script.&lt;br /&gt;
&lt;br /&gt;
*[http://wiki.openflyers.org/wiki/images/0/00/Openflyers.zip Joomla plugin for OpenFlyers]&lt;/div&gt;</summary>
		<author><name>imported&gt;Claratte</name></author>
	</entry>
</feed>