[GeoNetwork-users] Metadata import

Hi folks,

I'm using geonetwork 2.10 on ubuntu 13.04. I've successfully exported my
metadata with mef.export service.

By now I need to import it into another geonetwork 2.10 also running on
ubuntu 13.04. I thought it would be as easy as the export procedure.

However, my try on the mef.import service did not work. I read the docs
where it says "Only users with the Administrator profile can run this
service". Then I tried the following (as explained by the user BartO in
http://osgeo-org.1560.x6.nabble.com/mef-import-with-curl-td3860332.html#a3860335
):

$ curl -v -c cookie.txt -XPOST -H 'Content-type: application/xml' -d
'<?xml version="1.0"
encoding="UTF-8"?><request><username>admin</username><password>admin</password></request>'
http://localhost:8080/geonetwork/srv/en/xml.user.login

== Here the output of this command: ==

* Adding handle: conn: 0x1090b30
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1090b30) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)

POST /geonetwork/srv/en/xml.user.login HTTP/1.1
User-Agent: curl/7.32.0
Host: localhost:8080
Accept: */*
Content-type: application/xml
Content-Length: 118

* upload completely sent off: 118 out of 118 bytes
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 20 Nov 2013 21:19:24 GMT
< Location: /geonetwork/srv/eng/xml.user.login
< Content-Length: 0
* Server Jetty(7.3.1.v20110307) is not blacklisted
< Server: Jetty(7.3.1.v20110307)
<
* Connection #0 to host localhost left intact

== Here is the output log of jetty: ==

2013-11-20 17:15:55,884 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Public
object - authentication not attempted
2013-11-20 17:15:55,899 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Secure
object: FilterInvocation: URL: /srv/en/xml.user.login; Attributes:
[permitAll]
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Previously
Authenticated:
org.springframework.security.authentication.AnonymousAuthenticationToken@anonymised.com:
Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true;
Details:
org.springframework.security.web.authentication.WebAuthenticationDetails@anonymised.com:
RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities:
ROLE_ANONYMOUS
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Authorization successful
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
RunAsManager did not change Authentication object

== I believe this command did not work because of the result of the import
command, as follows: ==

$ curl -v -b cookie.txt -F 'file_type=mef' -F 'mefFile=@./mef.export.19'
http://localhost:8080/geonetwork/srv/en/mef.import

== The output of this command ==
* Adding handle: conn: 0x1a9bbf0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1a9bbf0) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)

POST /geonetwork/srv/en/mef.import HTTP/1.1
User-Agent: curl/7.32.0
Host: localhost:8080
Accept: */*
Content-Length: 12912897
Expect: 100-continue
Content-Type: multipart/form-data;

boundary=------------------------853ba69e926cd2f4

< HTTP/1.1 301 Moved Permanently
< Date: Wed, 20 Nov 2013 21:21:28 GMT
< Location: /geonetwork/srv/eng/mef.import
< Content-Length: 0
< Connection: close
* Server Jetty(7.3.1.v20110307) is not blacklisted
< Server: Jetty(7.3.1.v20110307)
<
* Closing connection 0

== Here is the output log of jetty for this last command: ==

2013-11-20 17:21:28,899 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Public
object - authentication not attempted
2013-11-20 17:21:28,903 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Secure
object: FilterInvocation: URL: /srv/en/mef.import; Attributes: [permitAll]
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Previously
Authenticated:
org.springframework.security.authentication.AnonymousAuthenticationToken@anonymised.com:
Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true;
Details:
org.springframework.security.web.authentication.WebAuthenticationDetails@anonymised.com:
RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities:
ROLE_ANONYMOUS
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Authorization successful
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
RunAsManager did not change Authentication object

== Other searches about the login service on GN 2.10 ==
Jose Garcia wrote (
http://sourceforge.net/mailarchive/forum.php?thread_name=CAOcMK%3Dh2k_Y46y2a7SSKTyc3WuuSW%2BgAE9urzdbVN7Vps1SoaA%40mail.gmail.com&forum_name=geonetwork-users)
that "GeoNetwork 2.10 uses Spring Security and no longer the xml.login
service. If I'm not wrong, Basic Authentication is enabled by default, so
you can send the credentials in the http request header."

And Ricardo Garcia Silva wrote that "I was able to login successfully by
issuing an HTTP POST request to:
http://localhost:8080/geonetwork/j_spring_security_check ..." (
http://osgeo-org.1560.x6.nabble.com/XML-Login-Service-in-Geonetwork-2-10-td5064670.html
)

I also found a permanent link in the file
./geonetwork/WEB-INF/urlrewrite.xml (line 149) from xml.user.login to the
j_spring_security_check: <from>^.*/.*/xml.user.login(\?.*)</from> <to
type="permanent-redirect"
last="true">%{context-path}/j_spring_security_check$1</to>. From what I
understand that accessing xml.user.login is the same as access
j_spring_security_check.

Following, I looked for the j_spring_security_check file and found it in
/usr/local/geonetwork/web/geoserver/j_spring_security_check but it is
empty.

Then I would like to ask: Looking at the logs above, does someone knows
whether to login worked or not for me ? And looking at the logs of the
mef.import command above, was the login fail the reason for it doesn't work
?

Thank you,
Alex Lopes Pereira

Hi Alex

In GeoNetwork 2.10 the service
xml.user.login<http://localhost:8080/geonetwork/srv/en/xml.user.login&gt;
should
not be longer used (the manual requires to be updated), you can send basic
authentication in curl using this parameter: -u admin:admin

Regards,
Jose García

On Fri, Nov 22, 2013 at 6:01 PM, Alex Lopes <alexlopespereira@anonymised.com>wrote:

Hi folks,

I'm using geonetwork 2.10 on ubuntu 13.04. I've successfully exported my
metadata with mef.export service.

By now I need to import it into another geonetwork 2.10 also running on
ubuntu 13.04. I thought it would be as easy as the export procedure.

However, my try on the mef.import service did not work. I read the docs
where it says "Only users with the Administrator profile can run this
service". Then I tried the following (as explained by the user BartO in

http://osgeo-org.1560.x6.nabble.com/mef-import-with-curl-td3860332.html#a3860335
):

$ curl -v -c cookie.txt -XPOST -H 'Content-type: application/xml' -d
'<?xml version="1.0"

encoding="UTF-8"?><request><username>admin</username><password>admin</password></request>'
http://localhost:8080/geonetwork/srv/en/xml.user.login

== Here the output of this command: ==

* Adding handle: conn: 0x1090b30
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1090b30) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /geonetwork/srv/en/xml.user.login HTTP/1.1
> User-Agent: curl/7.32.0
> Host: localhost:8080
> Accept: */*
> Content-type: application/xml
> Content-Length: 118
>
* upload completely sent off: 118 out of 118 bytes
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 20 Nov 2013 21:19:24 GMT
< Location: /geonetwork/srv/eng/xml.user.login
< Content-Length: 0
* Server Jetty(7.3.1.v20110307) is not blacklisted
< Server: Jetty(7.3.1.v20110307)
<
* Connection #0 to host localhost left intact

== Here is the output log of jetty: ==

2013-11-20 17:15:55,884 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Public
object - authentication not attempted
2013-11-20 17:15:55,899 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Secure
object: FilterInvocation: URL: /srv/en/xml.user.login; Attributes:
[permitAll]
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Previously
Authenticated:

org.springframework.security.authentication.AnonymousAuthenticationToken@...1281...
:
Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true;
Details:

org.springframework.security.web.authentication.WebAuthenticationDetails@...1282...
:
RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities:
ROLE_ANONYMOUS
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Authorization successful
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
RunAsManager did not change Authentication object

== I believe this command did not work because of the result of the import
command, as follows: ==

$ curl -v -b cookie.txt -F 'file_type=mef' -F 'mefFile=@anonymised.com/mef.export.19'
http://localhost:8080/geonetwork/srv/en/mef.import

== The output of this command ==
* Adding handle: conn: 0x1a9bbf0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1a9bbf0) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /geonetwork/srv/en/mef.import HTTP/1.1
> User-Agent: curl/7.32.0
> Host: localhost:8080
> Accept: */*
> Content-Length: 12912897
> Expect: 100-continue
> Content-Type: multipart/form-data;
boundary=------------------------853ba69e926cd2f4
>
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 20 Nov 2013 21:21:28 GMT
< Location: /geonetwork/srv/eng/mef.import
< Content-Length: 0
< Connection: close
* Server Jetty(7.3.1.v20110307) is not blacklisted
< Server: Jetty(7.3.1.v20110307)
<
* Closing connection 0

== Here is the output log of jetty for this last command: ==

2013-11-20 17:21:28,899 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Public
object - authentication not attempted
2013-11-20 17:21:28,903 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Secure
object: FilterInvocation: URL: /srv/en/mef.import; Attributes: [permitAll]
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Previously
Authenticated:

org.springframework.security.authentication.AnonymousAuthenticationToken@...1281...
:
Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true;
Details:

org.springframework.security.web.authentication.WebAuthenticationDetails@...1282...
:
RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities:
ROLE_ANONYMOUS
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Authorization successful
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
RunAsManager did not change Authentication object

== Other searches about the login service on GN 2.10 ==
Jose Garcia wrote (

http://sourceforge.net/mailarchive/forum.php?thread_name=CAOcMK%3Dh2k_Y46y2a7SSKTyc3WuuSW%2BgAE9urzdbVN7Vps1SoaA%40mail.gmail.com&forum_name=geonetwork-users
)
that "GeoNetwork 2.10 uses Spring Security and no longer the xml.login
service. If I'm not wrong, Basic Authentication is enabled by default, so
you can send the credentials in the http request header."

And Ricardo Garcia Silva wrote that "I was able to login successfully by
issuing an HTTP POST request to:
http://localhost:8080/geonetwork/j_spring_security_check ..." (

http://osgeo-org.1560.x6.nabble.com/XML-Login-Service-in-Geonetwork-2-10-td5064670.html
)

I also found a permanent link in the file
./geonetwork/WEB-INF/urlrewrite.xml (line 149) from xml.user.login to the
j_spring_security_check: <from>^.*/.*/xml.user.login(\?.*)</from> <to
type="permanent-redirect"
last="true">%{context-path}/j_spring_security_check$1</to>. From what I
understand that accessing xml.user.login is the same as access
j_spring_security_check.

Following, I looked for the j_spring_security_check file and found it in
/usr/local/geonetwork/web/geoserver/j_spring_security_check but it is
empty.

Then I would like to ask: Looking at the logs above, does someone knows
whether to login worked or not for me ? And looking at the logs of the
mef.import command above, was the login fail the reason for it doesn't work
?

Thank you,
Alex Lopes Pereira

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up
now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *

Dear Jose Garcia,

Your help once more, please.

I've tried your suggestion (curl with the parameter -u admin:admin) and it
did not work. The curl log displays the following:
--- My command ---
# curl -v -u admin:admin123 -F file_type=mef -F
mefFile=@/root/mef.export.19
http://localhost:8080/geonetwork/srv/en/mef.import

--- Curl output ---
* About to connect() to localhost port 8080
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080
* Server auth using Basic with user 'admin'

POST /geonetwork/srv/en/mef.import HTTP/1.1
Authorization: Basic YWRtaW46YWRtaW4xMjM=
User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5

OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5

Host: localhost:8080
Accept: */*
Content-Length: 12912897
Expect: 100-continue
Content-Type: multipart/form-data;

boundary=----------------------------998e9b27e5b1

< HTTP/1.1 100 Continue
HTTP/1.1 301 Moved Permanently
< Server: Apache-Coyote/1.1
< Set-Cookie: JSESSIONID=F96C6E8856274BD61E8C04AC667B6EE4;
Path=/geonetwork/; HttpOnly
< Location: /geonetwork/srv/eng/mef.import
< Content-Length: 0
< Date: Fri, 06 Dec 2013 21:43:52 GMT
* Connection #0 to host localhost left intact
* Closing connection #0
---

The catalina.out file does not changes when I run this curl command. Tomcat
outputs nothing to the log file.

Can you find out what is happening by looking at curl output? Is there a
log level parameter for geonetwork so that it outputs anything received
from curl?

Thank you very much,
--
Alex Lopes Pereira

On Mon, Nov 25, 2013 at 3:22 AM, Jose Garcia <jose.garcia@anonymised.com> wrote:

Hi Alex

In GeoNetwork 2.10 the service xml.user.login<http://localhost:8080/geonetwork/srv/en/xml.user.login&gt; should
not be longer used (the manual requires to be updated), you can send basic
authentication in curl using this parameter: -u admin:admin

Regards,
Jose García

On Fri, Nov 22, 2013 at 6:01 PM, Alex Lopes <alexlopespereira@anonymised.com>wrote:

Hi folks,

I'm using geonetwork 2.10 on ubuntu 13.04. I've successfully exported my
metadata with mef.export service.

By now I need to import it into another geonetwork 2.10 also running on
ubuntu 13.04. I thought it would be as easy as the export procedure.

However, my try on the mef.import service did not work. I read the docs
where it says "Only users with the Administrator profile can run this
service". Then I tried the following (as explained by the user BartO in

http://osgeo-org.1560.x6.nabble.com/mef-import-with-curl-td3860332.html#a3860335
):

$ curl -v -c cookie.txt -XPOST -H 'Content-type: application/xml' -d
'<?xml version="1.0"

encoding="UTF-8"?><request><username>admin</username><password>admin</password></request>'
http://localhost:8080/geonetwork/srv/en/xml.user.login

== Here the output of this command: ==

* Adding handle: conn: 0x1090b30
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1090b30) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /geonetwork/srv/en/xml.user.login HTTP/1.1
> User-Agent: curl/7.32.0
> Host: localhost:8080
> Accept: */*
> Content-type: application/xml
> Content-Length: 118
>
* upload completely sent off: 118 out of 118 bytes
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 20 Nov 2013 21:19:24 GMT
< Location: /geonetwork/srv/eng/xml.user.login
< Content-Length: 0
* Server Jetty(7.3.1.v20110307) is not blacklisted
< Server: Jetty(7.3.1.v20110307)
<
* Connection #0 to host localhost left intact

== Here is the output log of jetty: ==

2013-11-20 17:15:55,884 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Public
object - authentication not attempted
2013-11-20 17:15:55,899 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Secure
object: FilterInvocation: URL: /srv/en/xml.user.login; Attributes:
[permitAll]
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Previously
Authenticated:

org.springframework.security.authentication.AnonymousAuthenticationToken@anonymised.com
:
Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true;
Details:

org.springframework.security.web.authentication.WebAuthenticationDetails@anonymised.com
:
RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities:
ROLE_ANONYMOUS
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Authorization successful
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
RunAsManager did not change Authentication object

== I believe this command did not work because of the result of the import
command, as follows: ==

$ curl -v -b cookie.txt -F 'file_type=mef' -F 'mefFile=@anonymised.com/mef.export.19'
http://localhost:8080/geonetwork/srv/en/mef.import

== The output of this command ==
* Adding handle: conn: 0x1a9bbf0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1a9bbf0) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /geonetwork/srv/en/mef.import HTTP/1.1
> User-Agent: curl/7.32.0
> Host: localhost:8080
> Accept: */*
> Content-Length: 12912897
> Expect: 100-continue
> Content-Type: multipart/form-data;
boundary=------------------------853ba69e926cd2f4
>
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 20 Nov 2013 21:21:28 GMT
< Location: /geonetwork/srv/eng/mef.import
< Content-Length: 0
< Connection: close
* Server Jetty(7.3.1.v20110307) is not blacklisted
< Server: Jetty(7.3.1.v20110307)
<
* Closing connection 0

== Here is the output log of jetty for this last command: ==

2013-11-20 17:21:28,899 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Public
object - authentication not attempted
2013-11-20 17:21:28,903 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Secure
object: FilterInvocation: URL: /srv/en/mef.import; Attributes: [permitAll]
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Previously
Authenticated:

org.springframework.security.authentication.AnonymousAuthenticationToken@anonymised.com
:
Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true;
Details:

org.springframework.security.web.authentication.WebAuthenticationDetails@anonymised.com
:
RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities:
ROLE_ANONYMOUS
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Authorization successful
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
RunAsManager did not change Authentication object

== Other searches about the login service on GN 2.10 ==
Jose Garcia wrote (

http://sourceforge.net/mailarchive/forum.php?thread_name=CAOcMK%3Dh2k_Y46y2a7SSKTyc3WuuSW%2BgAE9urzdbVN7Vps1SoaA%40mail.gmail.com&forum_name=geonetwork-users
)
that "GeoNetwork 2.10 uses Spring Security and no longer the xml.login
service. If I'm not wrong, Basic Authentication is enabled by default, so
you can send the credentials in the http request header."

And Ricardo Garcia Silva wrote that "I was able to login successfully by
issuing an HTTP POST request to:
http://localhost:8080/geonetwork/j_spring_security_check ..." (

http://osgeo-org.1560.x6.nabble.com/XML-Login-Service-in-Geonetwork-2-10-td5064670.html
)

I also found a permanent link in the file
./geonetwork/WEB-INF/urlrewrite.xml (line 149) from xml.user.login to the
j_spring_security_check: <from>^.*/.*/xml.user.login(\?.*)</from> <to
type="permanent-redirect"
last="true">%{context-path}/j_spring_security_check$1</to>. From what I
understand that accessing xml.user.login is the same as access
j_spring_security_check.

Following, I looked for the j_spring_security_check file and found it in
/usr/local/geonetwork/web/geoserver/j_spring_security_check but it is
empty.

Then I would like to ask: Looking at the logs above, does someone knows
whether to login worked or not for me ? And looking at the logs of the
mef.import command above, was the login fail the reason for it doesn't
work
?

Thank you,
Alex Lopes Pereira

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up
now.

http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *

Hi Alex

The problem seem in the url, change to this one:
http://localhost:8080/geonetwork/srv/*eng*/mef.import&lt;http://localhost:8080/geonetwork/srv/eng/mef.import&gt;

Since version 2.8 the lang codes were changed to use iso 3 letters. A
redirection is done for old codes, but seem curl not managing properly.

Regards,
Jose García

On Fri, Dec 6, 2013 at 11:03 PM, Alex Lopes <alexlopespereira@anonymised.com>wrote:

Dear Jose Garcia,

Your help once more, please.

I've tried your suggestion (curl with the parameter -u admin:admin) and it
did not work. The curl log displays the following:
--- My command ---
# curl -v -u admin:admin123 -F file_type=mef -F
mefFile=@/root/mef.export.19
http://localhost:8080/geonetwork/srv/en/mef.import

--- Curl output ---
* About to connect() to localhost port 8080
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080
* Server auth using Basic with user 'admin'
> POST /geonetwork/srv/en/mef.import HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4xMjM=
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5
OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: localhost:8080
> Accept: */*
> Content-Length: 12912897
> Expect: 100-continue
> Content-Type: multipart/form-data;
boundary=----------------------------998e9b27e5b1
>
< HTTP/1.1 100 Continue
HTTP/1.1 301 Moved Permanently
< Server: Apache-Coyote/1.1
< Set-Cookie: JSESSIONID=F96C6E8856274BD61E8C04AC667B6EE4;
Path=/geonetwork/; HttpOnly
< Location: /geonetwork/srv/eng/mef.import
< Content-Length: 0
< Date: Fri, 06 Dec 2013 21:43:52 GMT
* Connection #0 to host localhost left intact
* Closing connection #0
---

The catalina.out file does not changes when I run this curl command.
Tomcat outputs nothing to the log file.

Can you find out what is happening by looking at curl output? Is there a
log level parameter for geonetwork so that it outputs anything received
from curl?

Thank you very much,
--
Alex Lopes Pereira

On Mon, Nov 25, 2013 at 3:22 AM, Jose Garcia <jose.garcia@anonymised.com>wrote:

Hi Alex

In GeoNetwork 2.10 the service xml.user.login<http://localhost:8080/geonetwork/srv/en/xml.user.login&gt; should
not be longer used (the manual requires to be updated), you can send basic
authentication in curl using this parameter: -u admin:admin

Regards,
Jose García

On Fri, Nov 22, 2013 at 6:01 PM, Alex Lopes <alexlopespereira@anonymised.com>wrote:

Hi folks,

I'm using geonetwork 2.10 on ubuntu 13.04. I've successfully exported my
metadata with mef.export service.

By now I need to import it into another geonetwork 2.10 also running on
ubuntu 13.04. I thought it would be as easy as the export procedure.

However, my try on the mef.import service did not work. I read the docs
where it says "Only users with the Administrator profile can run this
service". Then I tried the following (as explained by the user BartO in

http://osgeo-org.1560.x6.nabble.com/mef-import-with-curl-td3860332.html#a3860335
):

$ curl -v -c cookie.txt -XPOST -H 'Content-type: application/xml' -d
'<?xml version="1.0"

encoding="UTF-8"?><request><username>admin</username><password>admin</password></request>'
http://localhost:8080/geonetwork/srv/en/xml.user.login

== Here the output of this command: ==

* Adding handle: conn: 0x1090b30
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1090b30) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /geonetwork/srv/en/xml.user.login HTTP/1.1
> User-Agent: curl/7.32.0
> Host: localhost:8080
> Accept: */*
> Content-type: application/xml
> Content-Length: 118
>
* upload completely sent off: 118 out of 118 bytes
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 20 Nov 2013 21:19:24 GMT
< Location: /geonetwork/srv/eng/xml.user.login
< Content-Length: 0
* Server Jetty(7.3.1.v20110307) is not blacklisted
< Server: Jetty(7.3.1.v20110307)
<
* Connection #0 to host localhost left intact

== Here is the output log of jetty: ==

2013-11-20 17:15:55,884 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Public
object - authentication not attempted
2013-11-20 17:15:55,899 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Secure
object: FilterInvocation: URL: /srv/en/xml.user.login; Attributes:
[permitAll]
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Previously
Authenticated:

org.springframework.security.authentication.AnonymousAuthenticationToken@anonymised.com
:
Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true;
Details:

org.springframework.security.web.authentication.WebAuthenticationDetails@anonymised.com
:
RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities:
ROLE_ANONYMOUS
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Authorization successful
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
RunAsManager did not change Authentication object

== I believe this command did not work because of the result of the
import
command, as follows: ==

$ curl -v -b cookie.txt -F 'file_type=mef' -F 'mefFile=@anonymised.com/mef.export.19'
http://localhost:8080/geonetwork/srv/en/mef.import

== The output of this command ==
* Adding handle: conn: 0x1a9bbf0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1a9bbf0) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /geonetwork/srv/en/mef.import HTTP/1.1
> User-Agent: curl/7.32.0
> Host: localhost:8080
> Accept: */*
> Content-Length: 12912897
> Expect: 100-continue
> Content-Type: multipart/form-data;
boundary=------------------------853ba69e926cd2f4
>
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 20 Nov 2013 21:21:28 GMT
< Location: /geonetwork/srv/eng/mef.import
< Content-Length: 0
< Connection: close
* Server Jetty(7.3.1.v20110307) is not blacklisted
< Server: Jetty(7.3.1.v20110307)
<
* Closing connection 0

== Here is the output log of jetty for this last command: ==

2013-11-20 17:21:28,899 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Public
object - authentication not attempted
2013-11-20 17:21:28,903 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Secure
object: FilterInvocation: URL: /srv/en/mef.import; Attributes:
[permitAll]
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Previously
Authenticated:

org.springframework.security.authentication.AnonymousAuthenticationToken@anonymised.com
:
Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true;
Details:

org.springframework.security.web.authentication.WebAuthenticationDetails@anonymised.com
:
RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities:
ROLE_ANONYMOUS
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Authorization successful
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
RunAsManager did not change Authentication object

== Other searches about the login service on GN 2.10 ==
Jose Garcia wrote (

http://sourceforge.net/mailarchive/forum.php?thread_name=CAOcMK%3Dh2k_Y46y2a7SSKTyc3WuuSW%2BgAE9urzdbVN7Vps1SoaA%40mail.gmail.com&forum_name=geonetwork-users
)
that "GeoNetwork 2.10 uses Spring Security and no longer the xml.login
service. If I'm not wrong, Basic Authentication is enabled by default, so
you can send the credentials in the http request header."

And Ricardo Garcia Silva wrote that "I was able to login successfully by
issuing an HTTP POST request to:
http://localhost:8080/geonetwork/j_spring_security_check ..." (

http://osgeo-org.1560.x6.nabble.com/XML-Login-Service-in-Geonetwork-2-10-td5064670.html
)

I also found a permanent link in the file
./geonetwork/WEB-INF/urlrewrite.xml (line 149) from xml.user.login to the
j_spring_security_check: <from>^.*/.*/xml.user.login(\?.*)</from> <to
type="permanent-redirect"
last="true">%{context-path}/j_spring_security_check$1</to>. From what I
understand that accessing xml.user.login is the same as access
j_spring_security_check.

Following, I looked for the j_spring_security_check file and found it in
/usr/local/geonetwork/web/geoserver/j_spring_security_check but it is
empty.

Then I would like to ask: Looking at the logs above, does someone knows
whether to login worked or not for me ? And looking at the logs of the
mef.import command above, was the login fail the reason for it doesn't
work
?

Thank you,
Alex Lopes Pereira

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up
now.

http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *

Dear Jose García,

It finally worked. Thank you very much. It was really important and you
helped a lot.

Best regards,
Alex

On Mon, Dec 9, 2013 at 3:30 AM, Jose Garcia <jose.garcia@anonymised.com> wrote:

Hi Alex

The problem seem in the url, change to this one:
http://localhost:8080/geonetwork/srv/*eng*/mef.import&lt;http://localhost:8080/geonetwork/srv/eng/mef.import&gt;

Since version 2.8 the lang codes were changed to use iso 3 letters. A
redirection is done for old codes, but seem curl not managing properly.

Regards,
Jose García

On Fri, Dec 6, 2013 at 11:03 PM, Alex Lopes <alexlopespereira@anonymised.com>wrote:

Dear Jose Garcia,

Your help once more, please.

I've tried your suggestion (curl with the parameter -u admin:admin) and
it did not work. The curl log displays the following:
--- My command ---
# curl -v -u admin:admin123 -F file_type=mef -F
mefFile=@/root/mef.export.19
http://localhost:8080/geonetwork/srv/en/mef.import

--- Curl output ---
* About to connect() to localhost port 8080
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080
* Server auth using Basic with user 'admin'
> POST /geonetwork/srv/en/mef.import HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4xMjM=
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5
OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: localhost:8080
> Accept: */*
> Content-Length: 12912897
> Expect: 100-continue
> Content-Type: multipart/form-data;
boundary=----------------------------998e9b27e5b1
>
< HTTP/1.1 100 Continue
HTTP/1.1 301 Moved Permanently
< Server: Apache-Coyote/1.1
< Set-Cookie: JSESSIONID=F96C6E8856274BD61E8C04AC667B6EE4;
Path=/geonetwork/; HttpOnly
< Location: /geonetwork/srv/eng/mef.import
< Content-Length: 0
< Date: Fri, 06 Dec 2013 21:43:52 GMT
* Connection #0 to host localhost left intact
* Closing connection #0
---

The catalina.out file does not changes when I run this curl command.
Tomcat outputs nothing to the log file.

Can you find out what is happening by looking at curl output? Is there a
log level parameter for geonetwork so that it outputs anything received
from curl?

Thank you very much,
--
Alex Lopes Pereira

On Mon, Nov 25, 2013 at 3:22 AM, Jose Garcia <jose.garcia@anonymised.com>wrote:

Hi Alex

In GeoNetwork 2.10 the service xml.user.login<http://localhost:8080/geonetwork/srv/en/xml.user.login&gt; should
not be longer used (the manual requires to be updated), you can send basic
authentication in curl using this parameter: -u admin:admin

Regards,
Jose García

On Fri, Nov 22, 2013 at 6:01 PM, Alex Lopes <alexlopespereira@anonymised.com>wrote:

Hi folks,

I'm using geonetwork 2.10 on ubuntu 13.04. I've successfully exported my
metadata with mef.export service.

By now I need to import it into another geonetwork 2.10 also running on
ubuntu 13.04. I thought it would be as easy as the export procedure.

However, my try on the mef.import service did not work. I read the docs
where it says "Only users with the Administrator profile can run this
service". Then I tried the following (as explained by the user BartO in

http://osgeo-org.1560.x6.nabble.com/mef-import-with-curl-td3860332.html#a3860335
):

$ curl -v -c cookie.txt -XPOST -H 'Content-type: application/xml' -d
'<?xml version="1.0"

encoding="UTF-8"?><request><username>admin</username><password>admin</password></request>'
http://localhost:8080/geonetwork/srv/en/xml.user.login

== Here the output of this command: ==

* Adding handle: conn: 0x1090b30
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1090b30) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /geonetwork/srv/en/xml.user.login HTTP/1.1
> User-Agent: curl/7.32.0
> Host: localhost:8080
> Accept: */*
> Content-type: application/xml
> Content-Length: 118
>
* upload completely sent off: 118 out of 118 bytes
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 20 Nov 2013 21:19:24 GMT
< Location: /geonetwork/srv/eng/xml.user.login
< Content-Length: 0
* Server Jetty(7.3.1.v20110307) is not blacklisted
< Server: Jetty(7.3.1.v20110307)
<
* Connection #0 to host localhost left intact

== Here is the output log of jetty: ==

2013-11-20 17:15:55,884 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Public
object - authentication not attempted
2013-11-20 17:15:55,899 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Secure
object: FilterInvocation: URL: /srv/en/xml.user.login; Attributes:
[permitAll]
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Previously
Authenticated:

org.springframework.security.authentication.AnonymousAuthenticationToken@anonymised.com
:
Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true;
Details:

org.springframework.security.web.authentication.WebAuthenticationDetails@anonymised.com
:
RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities:
ROLE_ANONYMOUS
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Authorization successful
2013-11-20 17:15:55,900 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
RunAsManager did not change Authentication object

== I believe this command did not work because of the result of the
import
command, as follows: ==

$ curl -v -b cookie.txt -F 'file_type=mef' -F 'mefFile=@anonymised.com/mef.export.19'
http://localhost:8080/geonetwork/srv/en/mef.import

== The output of this command ==
* Adding handle: conn: 0x1a9bbf0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1a9bbf0) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /geonetwork/srv/en/mef.import HTTP/1.1
> User-Agent: curl/7.32.0
> Host: localhost:8080
> Accept: */*
> Content-Length: 12912897
> Expect: 100-continue
> Content-Type: multipart/form-data;
boundary=------------------------853ba69e926cd2f4
>
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 20 Nov 2013 21:21:28 GMT
< Location: /geonetwork/srv/eng/mef.import
< Content-Length: 0
< Connection: close
* Server Jetty(7.3.1.v20110307) is not blacklisted
< Server: Jetty(7.3.1.v20110307)
<
* Closing connection 0

== Here is the output log of jetty for this last command: ==

2013-11-20 17:21:28,899 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Public
object - authentication not attempted
2013-11-20 17:21:28,903 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] - Secure
object: FilterInvocation: URL: /srv/en/mef.import; Attributes:
[permitAll]
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Previously
Authenticated:

org.springframework.security.authentication.AnonymousAuthenticationToken@anonymised.com
:
Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true;
Details:

org.springframework.security.web.authentication.WebAuthenticationDetails@anonymised.com
:
RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities:
ROLE_ANONYMOUS
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
Authorization successful
2013-11-20 17:21:28,904 DEBUG
[jeeves.config.springutil.GeonetworkFilterSecurityInterceptor] -
RunAsManager did not change Authentication object

== Other searches about the login service on GN 2.10 ==
Jose Garcia wrote (

http://sourceforge.net/mailarchive/forum.php?thread_name=CAOcMK%3Dh2k_Y46y2a7SSKTyc3WuuSW%2BgAE9urzdbVN7Vps1SoaA%40mail.gmail.com&forum_name=geonetwork-users
)
that "GeoNetwork 2.10 uses Spring Security and no longer the xml.login
service. If I'm not wrong, Basic Authentication is enabled by default,
so
you can send the credentials in the http request header."

And Ricardo Garcia Silva wrote that "I was able to login successfully by
issuing an HTTP POST request to:
http://localhost:8080/geonetwork/j_spring_security_check ..." (

http://osgeo-org.1560.x6.nabble.com/XML-Login-Service-in-Geonetwork-2-10-td5064670.html
)

I also found a permanent link in the file
./geonetwork/WEB-INF/urlrewrite.xml (line 149) from xml.user.login to
the
j_spring_security_check: <from>^.*/.*/xml.user.login(\?.*)</from> <to
type="permanent-redirect"
last="true">%{context-path}/j_spring_security_check$1</to>. From what I
understand that accessing xml.user.login is the same as access
j_spring_security_check.

Following, I looked for the j_spring_security_check file and found it in
/usr/local/geonetwork/web/geoserver/j_spring_security_check but it is
empty.

Then I would like to ask: Looking at the logs above, does someone knows
whether to login worked or not for me ? And looking at the logs of the
mef.import command above, was the login fail the reason for it doesn't
work
?

Thank you,
Alex Lopes Pereira

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and
game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up
now.

http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and
metadata on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *

--

* GeoCat Bridge for ArcGIS allows instant publishing of data and metadata
on GeoServer and GeoNetwork. Visit http://geocat.net
<http://geocat.net/&gt; for details. _________________________Jose
GarcíaGeoCat bvVeenderweg 13 6721 WD BennekomThe
Netherlandshttp://GeoCat.net/> *