PAPI Archivos

The PAPI authentication and authorization framework

PAPI@LISTSERV.REDIRIS.ES

Opciones: Vista Forum

Use Monospaced Font
Por defecto enseñar Text Part
Mostrar todas las cabeceras de correo

Mensaje: [<< Primero] [< Prev] [Siguiente >] [Último >>]
Tema: [<< Primero] [< Prev] [Siguiente >] [Último >>]
Autor: [<< Primero] [< Prev] [Siguiente >] [Último >>]

Print Responder
Subject:
Emisor:
Daniel García <[log in para visualizar]>
Reply To:
The PAPI authentication and authorization framework <[log in para visualizar]>
Fecha:
Mon, 22 Dec 2008 13:16:03 +0100
Content-Type:
multipart/signed
Parts/Attachments:
text/plain (18 kB) , smime.p7s (18 kB)

El 19/12/2008, a las 20:53, Mikel Carrasco escribió:

> Hola Dani:
>
> Ante todo gracias por conestarme. He estado liado estos dias y no  
> habia puesto en practica lo que me habias mandado. Ya lo ha hecho y  
> el resultado es el mismo.. No entiedo bien las instrucciones que  
> añades al host virtual:
>
>
Esto lo que hace es que cualquier dirección del tipo:

https://www.example.com/AS
https://www.example.com/AS/

se resuelve al AuthServer.


>
>
> Yo estoy haciendo pruebas en dos maquinas diferentes, una de AS y  
> otro de PoA. Estas dos instrucciones son validas para el modelo de  
> AS y PoA  en diferentes maquinas?. Tambien les indica donde esta el  
> AuthServer en la maquina remota?

En la máquina donde está el PoA, no debes poner las líneas:
# Esto declara donde está el AuthServer (la pagina de autenticación)
ScriptAliasMatch ^/AS/$ "/home/spool/PAPI/test/AS/AuthServer"
ScriptAliasMatch ^/AS$ "/home/spool/PAPI/test/AS/AuthServer"

>
>
> He vuelto a generar el fichero que define el virtual host siguiendo  
> tus consejos. He cambiado la localizacion del virtual host tambien:
>
> *NameVirtualHost 158.227.101.41:443
> <VirtualHost 158.227.101.41:443>
> ServerAdmin webmaster@localhost
> ServerName  scuc01.sc.ehu.es
> SSLEngine On
> SSLCertificateFile /etc/apache2/server.crt
> SSLCertificateKeyFile /etc/apache2/server.key
>
> DocumentRoot /papi/
> DirectoryIndex index.html index.es.html
> CustomLog /var/log/AS_&_PoA_access_log common
> ErrorLog  /var/log/AS_&_PoA_error_log
> LogLevel debug
>
> # Esto declara donde esta AuthServer (la pagina de autenticacion).  
> He puesto el path donde se encuentra el AuthServer en el host remoto.
> ScriptAliasMatch ^/AS/$ "/var/www/cgi-bin/AuthServer"
> ScriptAliasMatch ^/AS$ "/var/www/cgi-bin/AuthServer"
>
> ErrorDocument 403 /papi-noauth.phtml
>
> <Location />
>
>   PerlSetVar          Service_ID papizado
>   PerlOptions         +ParseHeaders
>   SetHandler          perl-script
>   PerlFixupHandler    PAPI::DirectoryFixup
>   PerlAccessHandler   PAPI::Main
> </Location>
> ErrorLog /var/log/apache2/error.log
Esta línea está duplicada
>
>
>       # Possible values include: debug, info, notice, warn, error,  
> crit,
>       # alert, emerg.
>       LogLevel debug
>
>       CustomLog /var/log/apache2/access.log combined
>       ServerSignature On
>
>       Alias /simplesaml "/var/simplesamlphp_1_1/www"
>
>   Alias /doc/ "/usr/share/doc/"
>   <Directory "/usr/share/doc/">
>       Options Indexes MultiViews FollowSymLinks
>       AllowOverride None
>       Order deny,allow
>       Deny from all
>       Allow from 127.0.0.0/255.0.0.0 ::1/128
>   </Directory>
>
> </VirtualHost>
> *
>
>
> De todos modos, cuando intento acceder al recurso papizado me pone  
> lo siguiente en el erro.log del apache2.
>
> *[Fri Dec 19 20:36:59 2008] [notice] [client 158.227.105.55]  
> PAPI#19790_1229715419: PoA::set_parameters# Servername =  
> <scuc01.sc.ehu.es>\n
> [Fri Dec 19 20:36:59 2008] [notice] [client 158.227.105.55]  
> PAPI#19790_1229715419: PoA::set_parameters# Server_ID = <papizado>\n
> [Fri Dec 19 20:36:59 2008] [debug] ApachePoA.pm(105): [client  
> 158.227.105.55] PAPI-DEBUG#19790_1229715419_papizado: Parameters  
> initialized:$VAR1 = bless( {\n                 'Filtered' =>  
> 1,\n                 'Accept_File' => './images/image_ok.png', 
> \n                 'String' => '/',\n                 'attrList' =>  
> [],\n                 'filters' => [],\n                 'PxCkSize'  
> => 320768,\n                 'ApacheRequest' => bless( do{\\(my $o =  
> 143242416)}, 'Apache2::RequestRec' ),\n                 'Type' =>  
> 'Location',\n                 'Hcook_Handler' => undef, 
> \n                 'registerKey' => '',\n                  
> 'MxNonceErr' => 3,\n                 'PoARw' => [], 
> \n                 'URL_Timeout' => '1800',\n                  
> 'Lcook_Name' => 'PAPILcook_L_papizado',\n                 'SPOCPAct'  
> => 'accept',\n                 'SPOCPAcc' => 0,\n                  
> 'registerVal' => '',\n                 'hdRedirects' => [], 
> \n                 'Domain' => 'scuc01.sc.ehu.es',\n                  
> 'formProc' => {},\n                 'Auth_Location' => '/PAPI/ 
> cookie_handler.cgi',\n                 'RejPostPatterns' => [], 
> \n                 'postRedirects' => [],\n                 'port'  
> => '443',\n                 'url_redirects' => [],\n                  
> 'PAPI::ApachePoA' => undef,\n                 'RewUrlPatterns' => [], 
> \n                 'redirects' => [],\n                 'rawHcook'  
> => '',\n                 'Loc_pattern' => qr/(?-xism:\\\\/)/, 
> \n                 'cookieRejects' => [],\n                  
> 'PassPostPatterns' => [],\n                 'CRC_Timeout' => '1800', 
> \n                 'RejUrlPatterns' => [],\n                  
> 'PassUrlPatterns' => [],\n                 'Loc' => '/', 
> \n                 'signoffLocs' => [],\n                 'Debug' =>  
> '1',\n                 'HttpAuth' => [],\n                 'Req_DB'  
> => '/etc/apache2/PAPI/req_db.mldbm',\n                 'log' =>  
> bless( do{\\(my $o = 143242416)}, 'Apache2::Log::Request' ), 
> \n                 'Location' => '/',\n                 'Hkey' =>  
> 'YWNhOWZkNzE4MDRhNGU3YjVhNDM1ODkxNzgwMzNmOTU=',\n                  
> 'Independent' => 0,\n                 'Id' =>  
> '19790_1229715419_papizado',\n                 'Serv' => 'papizado', 
> \n                 'Lcook_Timeout' => '18000',\n                  
> 'Lkey' => 'ZjYwNTk2NGEyMGNjNjhkMmZlZjM0NDMwMDlhNWYyMWU=', 
> \n                 'Pubkeys_Path' => '/etc/ssl/certs/', 
> \n                 'ases' => {\n                              
> 'as.sc.ehu.es' => {\n                                                
> 'desc' => 'ASPruebas', 
> \n                                               'url' => 'https://as.sc.ehu.es/cgi-bin/AuthServer' 
> \n                                             }, 
> \n                             'PAPI_ID' =>  
> {\n                                          'desc' => '"Our PAPI  
> AuthServer"',\n                                          'url' =>  
> undef\n                                        } 
> \n                           },\n                 'Reject_File' =>  
> './images/image_nok.png',\n                 'Hcook_Name' =>  
> 'PAPIHcook_L_papizado',\n                 'Hcook_DB' => '/etc/ 
> apache2/PAPI/hcookdb'\n               }, 'PAPI::ApachePoA' );\n
> [Fri Dec 19 20:36:59 2008] [debug] ApachePoA.pm(105): [client  
> 158.227.105.55] PAPI-DEBUG#19790_1229715419_papizado: Processing  
> request: /
> [Fri Dec 19 20:36:59 2008] [debug] ApachePoA.pm(105): [client  
> 158.227.105.55] PAPI-DEBUG#19790_1229715419_papizado: Checking the  
> Pass_URL_Patterns
> [Fri Dec 19 20:36:59 2008] [debug] Main.pm(129): [client  
> 158.227.105.55] PAPI#Debug: Main Processing request: /
> [Fri Dec 19 20:36:59 2008] [debug] ApachePoA.pm(105): [client  
> 158.227.105.55] PAPI-DEBUG#19790_1229715419_papizado: Processing  
> request: /
> [Fri Dec 19 20:36:59 2008] [debug] ApachePoA.pm(105): [client  
> 158.227.105.55] PAPI-DEBUG#19790_1229715419_papizado: Main: Cookies  
> received:\n Hcook=##, Lcook=##
> [Fri Dec 19 20:36:59 2008] [warn] [client 158.227.105.55]  
> PAPI#19790_1229715419_papizado: Lcook is empty
> [Fri Dec 19 20:36:59 2008] [notice] [client 158.227.105.55]  
> PAPI#19790_1229715419_papizado: Hcook is empty
> [Fri Dec 19 20:36:59 2008] [warn] [client 158.227.105.55]  
> PAPI#19790_1229715419_papizado: Forbidden access to /
> [Fri Dec 19 20:36:59 2008] [error] [client 158.227.105.55] failed to  
> resolve handler `PAPI::DirectoryFixup': Can't locate PAPI/ 
> DirectoryFixup.pm in @INC (@INC contains: /etc/perl /usr/local/lib/ 
> perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/ 
> perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/ 
> site_perl . /etc/apache2) at (eval 27) line 3.\n
Esto falla porque te falta el módulo PAPI::DirectoryFixup, deberías  
actualizar la versión de PAPI, pq este módulo lo añadimos creo que en  
la rc2 del PAPI-1.5

>
> [Fri Dec 19 20:36:59 2008] [debug] ssl_engine_kernel.c(1770):  
> OpenSSL: Write: SSL negotiation finished successfully
> [Fri Dec 19 20:36:59 2008] [info] [client 158.227.105.55] Connection  
> closed to child 3 with standard shutdown (server scuc01.sc.ehu.es:443)
> *
>
> Me mosquea este warning: [warn] [client 158.227.105.55]  
> PAPI#19790_1229715419_papizado: Lcook is empty. He definido en el  
> papi_conf.xml:
Esto es normal, siempre que no se haya llegado con una AuthNCook (es  
decir que se haya pasado correctamente la autenticación en el  
AuthServer). El problema es lo que te decía más arriba del  
PAPI::DirectoryFixup.

>
>
> <*?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE PAPI_Configuration SYSTEM "file:///etc/apache2/PAPI/papi_conf.dtd 
> ">
> <PAPI_Configuration>
>   <Global>
>       <Accept_File>./images/image_ok.png</Accept_File>
>       <Reject_File>./images/image_nok.png</Reject_File>
>       <Debug>1</Debug>
>       <HKey>YWNhOWZkNzE4MDRhNGU3YjVhNDM1ODkxNzgwMzNmOTU=</HKey>
>       <LKey>ZjYwNTk2NGEyMGNjNjhkMmZlZjM0NDMwMDlhNWYyMWU=</LKey>
>       <Pubkeys_Path>/usr/local/apache/conf/PAPIConf/PoA</Pubkeys_Path>
> <!--        <Hcook_DB>/usr/local/apache/conf/PAPIConf/PoA/hcookdb</ 
> Hcook_DB> -->
>       <Hcook_DB>/etc/apache2/PAPI/hcookdb</Hcook_DB>
>       <Lcook_Timeout>18000</Lcook_Timeout>
>       <CRC_Timeout>1800</CRC_Timeout>
>       <URL_Timeout>1800</URL_Timeout>
>       <Req_DB>/usr/local/apache/conf/PAPIConf/PoA/req_db.mldbm</ 
> Req_DB>
>       <PAPI_AS id="PAPI_ID" url="http://server.subdomain.dom/cgi-bin/AuthServer 
> ">"Our PAPI AuthServer"</PAPI_AS>
>   </Global>
>    <!-- Protecting a whole remote domain -->
>   <!-- This code is for Mixed Configuration -->
>   <Server name="scuc01.sc.ehu.es" port="443" independent="0">
>       <Location path="/" id="papizado" filtered="true"  
> independent="false">
>               <Auth_Location>/PAPI/cookie_handler.cgi</Auth_Location>
>               <Accept_File>./images/image_ok.png</Accept_File>
>               <Reject_File>./images/image_nok.png</Reject_File>
>               <Debug>1</Debug>
>               <HKey>YWNhOWZkNzE4MDRhNGU3YjVhNDM1ODkxNzgwMzNmOTU=</ 
> HKey>
>               <LKey>ZjYwNTk2NGEyMGNjNjhkMmZlZjM0NDMwMDlhNWYyMWU=</ 
> LKey>
>               <Pubkeys_Path>/etc/ssl/certs/</Pubkeys_Path>
>               <Hcook_DB>/etc/apache2/PAPI/hcookdb</Hcook_DB>
>               <Lcook_Timeout>18000</Lcook_Timeout>
>               <Req_DB>/etc/apache2/PAPI/req_db.mldbm</Req_DB>
>               <PAPI_AS id="as.sc.ehu.es" url="https://as.sc.ehu.es/cgi-bin/AuthServer 
> ">ASPruebas</PAPI_AS>
>
>       </Location>
>   </Server>
>
> *Perdon por si he puesto alguna burrada y darte la chapa, pero  
> supongo que si hago funcionar esto, no tendre problemas en otros PoA.
No te preocupes por la chapa ;-)

A ver para aclarar un par de cosas más, ¿el flujo de operaciones que  
haces es este?

1º-. Accedes al AS [https://as.sc.ehu.es/AS/]
2º.- Realizas la autenticación, y compruebas que la cookie AuthNCook  
se ha creado en el navegador.
3º.- Accedes al PoA [http://scuc01.sc.ehu.es/]


>
>
> Gracias de antemano.

	De nada, SaludoS
>
>
> Mikel.
>
>
> *
> *
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Daniel García escribió:
>>
>>
>>    Hola Mikel,
>>
>> Un par de comentarios sobre la configuración de Apache (van entre  
>> líneas)
>>
>> El 05/12/2008, a las 20:14, Mikel Carrasco escribió:
>>
>>> Hola Dani:
>>>
>>> Hace algun tiempecillo te envie un mensaje comentandote los  
>>> problemas que tengo para papizar recursos. No se si al final te  
>>> llego. La historia es que cada vez que vuelve Libo de una reunion  
>>> vuestra de Red Iris, viene con la idea de que hay que instalar  
>>> PAPI, o rodara mi cabeza. La historia es que era incapaz de  
>>> "papizar" una pagina web  de apache ya que me daba:
>>>
>>>
>>> Forbidden
>>>
>>> You don't have permission to access /prueba/ on this server.
>>>
>>> El fichero de virtual host es el siguiente:
>>>
>>> NameVirtualHost 158.227.101.41:443
>>> <VirtualHost 158.227.101.41:443>
>>>      ServerAdmin webmaster@localhost
>>>      ServerName  scuc01.sc.ehu.es
>>>      SSLEngine On
>>>      SSLCertificateFile /etc/apache2/server.crt
>>>      SSLCertificateKeyFile /etc/apache2/server.key
>>>      DocumentRoot /var/www/
>>> #Añadido para PAPI
>>>
>>>      <Location /prueba>
>>>              AllowOverride None
>>>              Order allow,deny
>>>              Allow from all
>>        #Yo eliminaría las 3 líneas anteriores, ya que dichos  
>> controles los puedes realizar con filtros de PAPI, pero no es  
>> necesario.
>>>                  PerlSetVar              Service_ID Mi_PoA_ID
>>>              PerlOptions             +ParseHeaders
>>>              SetHandler              perl-script
>>        # Y añadiria:
>>        PerlFixupHandler    PAPI::DirectoryFixup
>>        # Esto es para corregir un problemilla con los  
>> DirectoryIndex que da Apache2. De momento es un parche, pero  
>> estamos tratando de
>>        # hacerlo transparente.
>>>              PerlAccessHandler       PAPI::Main
>>>      </Location>
>>>
>>>      ScriptAlias /cgi-bin/ /var/www/cgi-bin/
>>>      <Directory "/var/wwww/cgi-bin/">
>>>              AllowOverride None
>>>              Order allow,deny
>>>              Allow from all
>>>      </Directory>
>>>
>>>      ErrorLog /var/log/apache2/error.log
>>>
>>>      # Possible values include: debug, info, notice, warn, error,  
>>> crit,
>>>      # alert, emerg.
>>>      LogLevel debug
>>>
>>>      CustomLog /var/log/apache2/access.log combined
>>>      ServerSignature On
>>>
>>>
>>> </VirtualHost>
>>>
>>> El tema es que Libo me ha dicho que a la hora de papizar una  
>>> pagina web, hay algo que no se debe de papizar, la pagina de  
>>> autentificacion. Eso es correcto? Como se hace?
>>
>> Te aclaro esto, si proteges la página de autenticación, no podras  
>> acceder a ella para autenticarte ¿no?... eso sería la pescadilla  
>> que se muerde la cola, para acceder debes autenticarte, y si para  
>> autenticarte debes acceder a algo que está protegido a menos que  
>> estés ya autenticado ¿no?
>>
>> Te mando un pequeño Virtualhost con todo a modo de ejemplo:
>>
>> <!--  
>> **************************************************************************** -->
>> <!-- * AuthServer & PoA -  
>> test.rediris.es                                       * -->
>> <!--  
>> **************************************************************************** -->
>> <VirtualHost *>
>>  ServerName test.rediris.es
>>  DocumentRoot /home/spool/PAPI/test
>>  DirectoryIndex index.html index.es.html
>>  CustomLog var/log/AS_&_PoA_access_log common
>>  ErrorLog  var/log/AS_&_PoA_error_log
>>  LogLevel debug
>>
>>  # Esto declara donde está el AuthServer (la pagina de autenticación)
>>  ScriptAliasMatch ^/AS/$ "/home/spool/PAPI/test/AS/AuthServer"
>>  ScriptAliasMatch ^/AS$ "/home/spool/PAPI/test/AS/AuthServer"
>>
>>  ErrorDocument 403 /papi-noauth.phtml
>>
>> <Location /papizado>
>>    Options FollowSymLinks
>>    AllowOverride None
>>    Order Deny,Allow
>>    Allow .rediris.es
>>    Deny from all
>>
>>    PerlSetVar          ServiceID papizado
>>    PerlOptions         +ParseHeaders
>>    SetHandler          perl-script
>>    PerlFixupHandler    PAPI::DirectoryFixup
>>    PerlAccessHandler   PAPI::Main
>>  </Location>
>> </VirtualHost>
>>
>> Con esto tienes las 2 urls siguientes:
>>
>> http://test.rediris.es/AS (página de autenticación de acceso libre).
>> http://test.rediris.es/papizado (página protegida, solo accesible  
>> una vez que te hayas autenticado) (todo lo que está por debajo de  
>> dicha url también estaría protegido).
>>
>> La configuración para esto sería algo así como:
>>
>> <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
>> <!DOCTYPE PAPI_Configuration SYSTEM "file:///...../papi_conf.dtd">
>> <PAPI_Configuration>
>> <Global>
>>  <Auth_Location>/papiPoA</Auth_Location>
>>  <Accept_File>/....../accept-file</Accept_File>
>>  <Reject_File>/....../reject-file</Reject_File>
>>  <Debug>1</Debug>
>>  <HKey>95e17eea42015cc1f069f587e8e1fc85</HKey>
>>  <LKey>f4a438aeb80afad4b4921cc5cb81313a</LKey>
>>  <Pubkeys_Path>/....../KEYS</Pubkeys_Path>
>>  <Hcook_DB>/....../hcookdb</Hcook_DB>
>>  <Lcook_Timeout>18000</Lcook_Timeout>
>>  <CRC_Timeout>1800</CRC_Timeout>
>>  <URL_Timeout>1800</URL_Timeout>
>>  <Req_DB>/....../req_db.mldbm</Req_DB>
>> </Global>
>>
>> <!--  
>> *********************************************************************** -->
>> <!-- *  
>> test.rediris.es                                                      
>> * -->
>> <!--  
>> *********************************************************************** -->
>> <Server name="test.rediris.es" port="80" independent="0">
>>  <Debug>1</Debug>
>>  <Location path="/papizado" id="papizado" filtered="true"  
>> independent="1">
>>    <HKey>0c5064330bd7892d4c314bf589afe0e2</HKey>
>>    <LKey>808f3a12fc8f1da47692b0599f6776fc</LKey>
>>    <Pubkeys_Path>/....../KEYS</Pubkeys_Path>
>>    <Hcook_DB>/....../hcook</Hcook_DB>
>>    <Lcook_Timeout>3600</Lcook_Timeout>
>>    <Req_DB>/....../DBs/reqs</Req_DB>
>>    <PAPI_AS id="test.rediris.es" url="http://test.rediris.es/ 
>> AS/">The TEST PAPI AS at RedIRIS</PAPI_AS>
>>  </Location>
>> </Server>
>> </PAPI_Configuration>
>>
>>
>> Como ves sólo se declara un PoA, al igual que en Apache, y a dicho  
>> PoA le indicamos que su AS es http://test.rediris.es/AS/ (como  
>> sabás al AS le tienes indicar que reconozca este PoA)
>>
>>
>>    Saludos
>>
>> P.D. como siempre para cualquier cosa no dudes en preguntar.
>>
>>
>>>
>>>
>>> Me podrias echar un cable en este tema?
>>>
>>> Gracias de antemano.
>>>
>>> Mikel.
>>>
>>
>> -- 
>> Daniel García Franco        E-mail: [log in para visualizar]
>>                Jabber: [log in para visualizar]
>> Red.es/RedIRIS            Tef:+34 955 05 66 23
>> Edificio CICA
>> Avenida Reina Mercedes, s/n
>> 41012 Sevilla
>> SPAIN
>>
>> - Red Académica y Científica española (http://www.rediris.es) -
>> - Spanish NREN (http://www.rediris.es) -
>>
>

--
Daniel García Franco		E-mail: [log in para visualizar]
				Jabber: [log in para visualizar]
Red.es/RedIRIS			Tef:+34 955 05 66 23
Edificio CICA
Avenida Reina Mercedes, s/n
41012 Sevilla
SPAIN

- Red Académica y Científica española (http://www.rediris.es) -
- Spanish NREN (http://www.rediris.es) -



ATOM RSS1 RSS2