Skip to content
Snippets Groups Projects
Commit c0817c68 authored by Florian Azizian's avatar Florian Azizian
Browse files

conf cas

parent be7d9fe0
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,8 @@ $loginRequestArray = $core->object2array($xmlconfig);
$cas_serveur = $loginRequestArray['WEB_CAS_URL'];
$cas_port = $loginRequestArray['WEB_CAS_PORT'];
$cas_context = $loginRequestArray['WEB_CAS_CONTEXT'];
$id_separator = $loginRequestArray['ID_SEPARATOR'];
$certificate = $loginRequestArray['PATH_CERTIFICATE'];
// $cas_chemin_ac = "apps/maarch_entreprise/tools/phpCAS/AC-RGS-Certigna-Racine-SHA1.pem" ;
phpCAS::setDebug();
......@@ -47,17 +49,22 @@ phpCAS::setVerbose(true);
phpCAS::client(constant($loginRequestArray['CAS_VERSION']), $cas_serveur, (int)$cas_port, $cas_context, true);
// Le certificat de l'autorité racine
// phpCAS::setCasServerCACert($cas_chemin_ac);
phpCAS::setNoCasServerValidation();
if(!empty($certificate)){
phpCAS::setCasServerCACert($certificate);
} else {
phpCAS::setNoCasServerValidation();
}
// L'authentification.
phpCAS::forceAuthentication();
if($loginRequestArray['CAS_VERSION'] == 'CAS_VERSION_2_0'){
// Lecture identifiant utilisateur (courriel)
$userId = phpCAS::getUser();
$Id = phpCAS::getUser();
echo 'Identifiant : ' . phpCAS::getUser();
echo '<br/> phpCAS version : ' . phpCAS::getVersion();
$tmpId = explode($id_separator, $Id);
$userId = $tmpId[0];
} elseif($loginRequestArray['CAS_VERSION'] == 'SAML_VERSION_1_1'){
// $attrSAML = phpCAS::getAttributes();
......
<?xml version="1.0" encoding="utf-8"?>
<ROOT>
<CAS_VERSION>CAS_VERSION_2_0</CAS_VERSION><!-- CAS_VERSION_2_0 ou SAML_VERSION_1_1 -->
<WEB_CAS_URL>192.168.21.30</WEB_CAS_URL>
<WEB_CAS_URL>192.168.21.25</WEB_CAS_URL> <!-- ip -->
<WEB_CAS_PORT>443</WEB_CAS_PORT>
<WEB_CAS_CONTEXT>/cas-server-webapp-4.0.0</WEB_CAS_CONTEXT>
</ROOT>
<ID_SEPARATOR>@</ID_SEPARATOR><!--return id without string after the separator include-->
<PATH_CERTIFICATE></PATH_CERTIFICATE><!--path to the cas server certificate. absolute path. empty if no certificate-->
</ROOT>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment