Class GNAuthentication
- java.lang.Object
-
- org.gcube.datatransfer.resolver.gis.geonetwork.GNAuthentication
-
public class GNAuthentication extends Object
The Class GNAuthentication.- Author:
- Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it May 16, 2017
-
-
Field Summary
Fields Modifier and Type Field Description static StringXML_USER_LOGOUT
-
Constructor Summary
Constructors Constructor Description GNAuthentication()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanlogin(HTTPCallsUtils connection, String serviceURL, String username, String password)Perform a GN login.
GN auth is carried out via a JSESSIONID cookie returned by a successful login call.
Url: http://server:port/geonetwork/srv/en/xml.user.login Mime-type: application/xml Post request:static booleanlogout(HTTPCallsUtils connection, String serviceURL)Logout.
-
-
-
Field Detail
-
XML_USER_LOGOUT
public static final String XML_USER_LOGOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
login
public static boolean login(HTTPCallsUtils connection, String serviceURL, String username, String password)
Perform a GN login.
GN auth is carried out via a JSESSIONID cookie returned by a successful login call.
- Url: http://server:port/geonetwork/srv/en/xml.user.login
- Mime-type: application/xml
- Post request:
<?xml version="1.0" encoding="UTF-8"?> <request> <username>user</username> <password>pwd</password> </request>
- Parameters:
connection- the connectionserviceURL- the service urlusername- the usernamepassword- the password- Returns:
- true, if successful
-
logout
public static boolean logout(HTTPCallsUtils connection, String serviceURL)
Logout.- Parameters:
connection- the connectionserviceURL- the service url- Returns:
- true, if successful
-
-