forked from melvincarvalho/libAuthentication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testLibAuthentication.php
33 lines (29 loc) · 1.38 KB
/
testLibAuthentication.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<h1>getAuth();</h1><b>Description:</b><br><br><span style="color:blue">The getAuth(); function checks if the presented SSL certificate has a subjectAltName with a URI pointing to a FOAF file holding a reference to the public key which matches the public key of the supplied client certificate.</span><br><br><b>Code :</b><br><br><span style="color:green"><?php require_once('./libAuthentication.php');<br><br>$auth = getAuth();<br><br>print_r($auth); ?></span><br><br><b>Returns :</b><br><pre>
Array
(
[certRSAKey] => Array
(
[modulus] => ...
[exponent] => 10001
)
[subjectAltName] => http://foaf.me/romeo#me
[subjectAltNameRSAKey] => Array
(
[modulus] => ...
[exponent] => 10001
)
[isAuthenticated] => [ 0 | 1 ] {Return 1 if the authentication process succeeds}
[authDiagnostic] => [ No client certificate supplied on an unsecure connection |
No client certificate supplied |
No RSA Key in the supplied client certificate |
Client Certificate RSAkey matches SAN RSAkey |
Client Certificate RSAkey does not match SAN RSAkey ]
)
</pre>
<b>Example Output:</b><br><span style="color:red"><b><pre>Array
(
[isAuthenticated] => 0
[authDiagnostic] => No client certificate supplied on an unsecure connection
)
</pre></b></span><br/>
<a href="http://foaf.me/download.html">Download</a>