Hi

First, please stay on the users list.

Return code 200 is fine, does your PHP library follow HTTP redirects. After
a login, an HTTP redirect happens to the admin GUI and this redirect must
include the session cookie called JSESSIONID.

Next problem is your GeoServer version. 2.2.x is out of support. If I find
a bug, I can only fix it in 2.3.x series. After you have installed  2.2.x
and migrated your data directory (this happens automatically), you should
install 2.3.2 .

Do you need access to the GUI or the OGC services. I assume the second one
and in this case, you should use basic authentication.

Cheers
Christian












2013/5/19 J.Alejandro Martinez Linares <[email protected]>

>  This is what i get when a analize the return of the curl request i made
> this die(printf_r($arrInfo)) and i get this:
>
> ------------------
> Array ( [url] =>
> http://localhost/geoserver/web/;jsessionid=zusl8frwtoz4?wicket:bookmarkablePage=:org.geoserver.web.GeoServerLoginPage&error=true[content_type]
>  => text/html; charset=utf-8 [http_code] => 200 [header_size]
> => 687 [request_size] => 618 [filetime] => -1 [ssl_verify_result] => 0
> [redirect_count] => 1 [total_time] => 14.234 [namelookup_time] => 0
> [connect_time] => 0 [pretransfer_time] => 0.047 [size_upload] => 0
> [size_download] => 15662 [speed_download] => 1100 [speed_upload] => 0
> [download_content_length] => 15662 [upload_content_length] => 0
> [starttransfer_time] => 9.687 [redirect_time] => 4.547 [certinfo] => Array
> ( ) [primary_ip] => 127.0.0.1 [primary_port] => 80 [local_ip] => 127.0.0.1
> [local_port] => 1232 [redirect_url] => ) 1
> ---------------------
>
> and reading this the http return code is 200, but i can not get in when
> this is made, this is not authenticating fine, what i am doing wrong, y the
> version 2.1.4 this same routine works fine, but in this version 2.2 of
> geoserver the routine is not working, help me please.
>
>
>
> On 19/05/13 01:38, Christian Mueller wrote:
>
> I am not a PHP developer, but the exception you see in the log is a
> warning, it does not prevent functionality.
>
>  Is there another exception ?
> What is your HTTP return code ?
>
>  Cheers
> Christian
>
>
> 2013/5/18 <[email protected]>
>
>> hello peoples, i need help, i got a problem, i need to auntenticate
>> throught php in geoserver, in the past with the version geoserver
>> 2.1.4 it work fine, but now i want to upgrade my map server to
>> geoserver 2.2 and the function dont work here, i dont know what to do,
>> help me please, here is the full function that i used and error that
>> geoserver 2.2 show, thanks to all.
>>
>>
>> public static function loginGeoserver($username, $password)
>>      {
>>          $post_data['username'] = $username;
>>          $post_data['password'] = $password;
>>          foreach ($post_data as $key => $value) {
>>              $post_items[] = $key . '=' . $value;
>>          }
>>          $post_string = implode('&', $post_items);
>>          $curl_connection = curl_init('http://' . master::$host .
>>              '/geoserver/j_spring_security_check');
>>          curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
>>          curl_setopt($curl_connection, CURLOPT_USERAGENT,
>>              "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
>>          curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
>>          curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
>>          curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
>>          curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
>>          $result = curl_exec($curl_connection);
>>          $arrInfo = curl_getinfo($curl_connection);
>>          $url = $arrInfo['url'];
>>          parse_str($url, $output);
>>          $trans = array("." => "_");
>>          $base = strtr(master::$host, $trans);
>>
>>
>>          if (master::getLoggedUser() != null) {
>>              if (master::getLoggedUser()->tieneRol("Operador"))
>>                  $str = "http://"; . $base . "/geoserver/web/;jsessionid";
>>              $str = "http://"; . $base . "/geoserver/;jsessionid";
>>
>>              curl_close($curl_connection);
>>              if (!empty($output[$str])) {
>>              } else {
>>                  //header('Location:
>> /geoportal/index.php?page=home.home&Error=GeoserverDown');
>>                                 header('Location:
>> /personal/index.php?page=inicio&Error=GeoserverDown');
>>              }
>>              setcookie('JSESSIONID', $output[$str], 0, '/geoserver');
>>              setcookie('JSESSIONID', $output[$str], 0, '/');
>>          } else {
>>              return null;
>>          }
>>
>>      }
>> -------------------------------------------------------
>> and the geoserver 2.2 logs show this
>> -----------------------------------------------------
>> 2013-05-17 22:37:48,863 INFO [ows.OWSHandlerMapping] - Mapped URL path
>> [/animate/*] onto handler 'dispatcher'
>> 2013-05-17 22:37:49,861 WARN [geoserver.security] -
>> E:\geoserver-2.2-RC1-bin\data_dir\security\users.properties.old could
>> be removed manually
>> 2013-05-17 22:46:23,167 INFO [geoserver.filters] - Creating a new http
>> session outside of the web UI! (normally not desirable), the path
>> is/j_spring_security_check
>> java.lang.Exception: Full stack trace for the session creation path
>>         at
>>
>> org.geoserver.filters.SessionDebugFilter$SessionDebugWrapper.getSession(SessionDebugFilter.java:93)
>>         at
>>
>> javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:227)
>>         at
>>
>> org.springframework.security.web.context.HttpSessionSecurityContextRepository$SaveToSessionResponseWrapper.createNewSessionIfAllowed(HttpSessionSecurityContextRepository.java:339)
>>         at
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>> --
>>
>> Este mensaje le ha llegado mediante el servicio de correo electronico que
>> ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema
>> Nacional de Salud. La persona que envia este correo asume el compromiso de
>> usar el servicio a tales fines y cumplir con las regulaciones establecidas
>>
>> Infomed: http://www.sld.cu/
>>
>>
>> ------------------------------------------------------------------------------
>> AlienVault Unified Security Management (USM) platform delivers complete
>> security visibility with the essential security capabilities. Easily and
>> efficiently configure, manage, and operate all of your security controls
>> from a single console and one unified framework. Download a free trial.
>> http://p.sf.net/sfu/alienvault_d2d
>> _______________________________________________
>> Geoserver-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>
>
>
>  --
> DI Christian Mueller MSc (GIS), MSc (IT-Security)
> OSS Open Source Solutions GmbH
>
>


-- 
DI Christian Mueller MSc (GIS), MSc (IT-Security)
OSS Open Source Solutions GmbH
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to