Class GNAuthentication


  • public class GNAuthentication
    extends Object
    The Class GNAuthentication.
    Author:
    Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it May 16, 2017
    • Constructor Detail

      • GNAuthentication

        public GNAuthentication()
    • 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 connection
        serviceURL - the service url
        username - the username
        password - the password
        Returns:
        true, if successful
      • logout

        public static boolean logout​(HTTPCallsUtils connection,
                                     String serviceURL)
        Logout.
        Parameters:
        connection - the connection
        serviceURL - the service url
        Returns:
        true, if successful