Précédent   Forum des professionnels en informatique > PHP > Langage > Fonctions
Fonctions Forum d'entraide sur les fonctions PHP. Avant de poster -> FAQ fonctions et Sources diverses
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 18/07/2011, 07h22   #1
Invité régulier
 
Homme eliott Lômbric
Étudiant
Inscription : juin 2011
Messages : 17
Détails du profil
Informations personnelles :
Nom : Homme eliott Lômbric
Localisation : Nouvelle-Calédonie

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : juin 2011
Messages : 17
Points : 9
Points : 9
Par défaut Authentifications sur serveur CAS

Bonjour à tous.

je suis étudiant et pas très calé en la matière.


Je doit créer ne page HTML/php afin de s'authentifier et accéder à une application.

les mots de passe et Login sont stockés sur un serveur CAS

Comment dois-je procéder?

voici mon code "de base".

Comment procéder pour se connecter et authentifier grâce aux mot de passe et login saisi?

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
 
<HTML>
 
<FORM METHOD ="POST" action = "SAIECO.html">
			<BR>
			Login : <INPUT TYPE = "text" name = "TF_Login" SIZE=20 MAXLENGHT=30 >
			<BR>
			Mot de passe : <INPUT TYPE= "text" name = "TF_MDP" SIZE = 20 MAXLENGHT = 30  > 
			<BR>
			<INPUT TYPE = "Submit" NAME = "Valider" VALUE = "Connexion">
</FORM>
<?php
if (isset($_POST['Valider']))
{
	$Login = $_POST['TF_Login'];
	$MDP = $_POST['TF_MDP'];
//que mettre ici?
 
};
?>
</HTML>
eliott est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 18/07/2011, 09h53   #2
Invité régulier
 
Homme eliott Lômbric
Étudiant
Inscription : juin 2011
Messages : 17
Détails du profil
Informations personnelles :
Nom : Homme eliott Lômbric
Localisation : Nouvelle-Calédonie

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : juin 2011
Messages : 17
Points : 9
Points : 9
Solution:

Code :
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
34
35
36
37
<?php
//
// phpCAS simple client
//
// import phpCAS lib
include_once('CAS.php');
 
phpCAS::setDebug();
 
// initialize phpCAS
phpCAS::client(CAS_VERSION_2_0,'fed.princeton.edu',8443,'cas');
 
// no SSL validation for the CAS server
phpCAS::setNoCasServerValidation();
 
// force CAS authentication
phpCAS::forceAuthentication();
 
// at this step, the user has been authenticated by the CAS server
// and the user's login name can be read with phpCAS::getUser().
// logout if desired
if (isset($_REQUEST['logout'])) {
 phpCAS::logout();
}
// for this test, simply print that the authentication was successful
?>
<html>
  <head>
    <title>phpCAS simple client</title>
  </head>
  <body>
    <h1>Successfull Authentication!</h1>
    <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
    <p>phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>.</p>
    <p><a href="?logout=">Logout</a></p>
  </body>
</html>
eliott est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 13h03.


 
 
 
 
Partenaires

Hébergement Web