Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Général Conception Web > Sécurité
Sécurité Forum d'entraide sur la sécurité des sites Web, les protections, l'authentification, etc. Avant de poster -> Cours Sécurité.
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 01/03/2008, 19h17   #1
Invité de passage
 
Inscription : mars 2008
Messages : 4
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 4
Points : 1
Points : 1
Par défaut authentification avec google

Bonjour,
J'ai un projet à réaliser avec la fac qui consiste à rendre accessible google calendar aux non-voyants. Pour cela j'ai utilisé l'API google et zend framework. Débutant dans la programmation internet, je n'ai pas réussi à résoudre mon problème, malgré mes recherches sur les nombreux forums. Mon problème est le suivant, lors de l'authentification, un message d'erreur s'affiche:


Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Unable to Connect to ssl://www.google.com:443. Error #22: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?' in C:\wamp\www\gapa\Zend\Gdata\AuthSub.php:114 Stack trace: #0 C:\wamp\www\gapa\authentification.php(56): Zend_Gdata_AuthSub::getAuthSubSessionToken('CLDG0OHqBBDbi43...') #1 C:\wamp\www\gapa\authentification.php(70): getAuthSubHttpClient() #2 {main} thrown in C:\wamp\www\gapa\Zend\Gdata\AuthSub.php on line 114

Je vous remercie par avance quelque soit l'aide que vous pourrez m'apportez.
mangameelooz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/03/2008, 20h45   #2
Nouveau Membre du Club
 
Inscription : décembre 2007
Messages : 36
Détails du profil
Informations forums :
Inscription : décembre 2007
Messages : 36
Points : 36
Points : 36
Et si tu remplaces ssl://www.google.com par https://www.google.com/ ?
riaStudio est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/03/2008, 21h06   #3
Invité de passage
 
Inscription : mars 2008
Messages : 4
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 4
Points : 1
Points : 1
Tout d'abord, merci pour ta réponse rapide. En faite, le code est le suivant et à aucun moment je ne fait de ssl mais en même temps j'ai repris entièrement le code de l'API et je dois avouer que certaines lignes restent un grand mystère...

<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Http_Client');

/** Retrieve the current URL so that the AuthSub server knows where to * redirect the user after authentication is complete. */
function getCurrentUrl(){
global $_SERVER;
// Filter php_self to avoid a security vulnerability.
$php_request_uri = htmlentities(substr($_SERVER['REQUEST_URI'], 0, strcspn($_SERVER['REQUEST_URI'], "\n\r")), ENT_QUOTES);
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')
{
$protocol = 'https://';
}
else
{
$protocol = 'http://';
}
$host = $_SERVER['HTTP_HOST'];
if ($_SERVER['HTTP_PORT'] != '' &&
(($protocol == 'http://' && $_SERVER['HTTP_PORT'] != '80') ||
($protocol == 'https://' && $_SERVER['HTTP_PORT'] != '443')))
{
$port = ':' . $_SERVER['HTTP_PORT'];
}
else
{
$port = '';
}
return $protocol . $host . $port . $php_request_uri;
}
/** Obtain an AuthSub authenticated HTTP client, redirecting the user to the * AuthSub server to login if necessary. */
function getAuthSubHttpClient(){
global $_SESSION, $_GET;
// If there is no AuthSub session or one-time token waiting for us,
// redirect the user to the AuthSub server to get one.
if (!isset($_SESSION['sessionToken']) && !isset($_GET['token'])) {
// Parameters to give to AuthSub server
$next = getCurrentUrl();
$scope = "http://www.google.com/calendar/feeds/";
$secure = false;
$session = true;
// Redirect the user to the AuthSub server to sign in
$authSubUrl = Zend_Gdata_AuthSub::getAuthSubTokenUri($next,$scope,$secure,$session);
header("HTTP/1.0 307 Temporary redirect");
header("Location: " . $authSubUrl);
exit();
}
// Convert an AuthSub one-time token into a session token if needed
if (!isset($_SESSION['sessionToken']) && isset($_GET['token'])) {
$_SESSION['sessionToken'] =
Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']);
}
// At this point we are authenticated via AuthSub and can obtain an
// authenticated HTTP client instance
// Create an authenticated HTTP client
$client = Zend_Gdata_AuthSub::getHttpClient($_SESSION['sessionToken']);
return $client;
}
// -> Script execution begins here <-
// Make sure http://code.google.com/apis/gdata/re...ml#Queriesthat the user has a valid session, so we can record the
// AuthSub session token once it is available.
session_start();
// Create an instance of the Calendar service, redirecting the user
// to the AuthSub server if necessary.
$service = new Zend_Gdata_Calendar(getAuthSubHttpClient());

?>
mangameelooz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/03/2008, 18h02   #4
Invité de passage
 
Inscription : mars 2008
Messages : 4
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 4
Points : 1
Points : 1
Par défaut Problème résolu

J'ai réussi à résoudre mon problème. Cela ne venait pas de ce code mais de httpd.conf de apache et php.ini
mangameelooz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/03/2008, 18h03   #5
Invité de passage
 
Inscription : mars 2008
Messages : 4
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 4
Points : 1
Points : 1
Par défaut Merci

Merci quand même de ton aide !!
mangameelooz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 19/05/2011, 17h17   #6
Invité de passage
 
Homme
Inscription : mai 2011
Messages : 1
Détails du profil
Informations personnelles :
Sexe : Homme

Informations forums :
Inscription : mai 2011
Messages : 1
Points : 1
Points : 1
Par défaut meme probleme

Bonjour,
j'ai eu le meme probleme que vous, aparament vous avez reglé le probleme en appliquant des modification au niveau de httpd.conf et de apache et php.ini, que ce que vous avez fait exactement !! merci d'avances
bigupinfo 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 08h03.


 
 
 
 
Partenaires

Hébergement Web