Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29

Thread: can't authenticate on soap

  1. #11
    Join Date
    Feb 2013
    Posts
    23
    Rep Power
    2

    Default

    Quote Originally Posted by tdesorbaix View Post
    If you are in Dev environment you could try to activate debug mode in the jetty configuration and chek the log mailbox.log to get more informations.
    thank you very much Mr tdesorbaix for your help, but i didn't understand how to activate debug mode in the jetty configuration, for developping my application i use eclipse and tomcat have i to change tomcat to jetty or have i to activate debug mode in the jetty config on zimbra server? how to do that?

  2. #12
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    In zimbra the logger mode can be changed in the file "log4j.properties.in" in "/opt/zimbra/conf", then you restart zimbra for the changes are made in the file "log4j.properties".
    You should have the same config file "log4j.properties" on your tomcat too.
    So you can activate debug mode on both platform to get as much informations as possible.

  3. #13
    Join Date
    Feb 2013
    Posts
    23
    Rep Power
    2

    Default

    Quote Originally Posted by tdesorbaix View Post
    In zimbra the logger mode can be changed in the file "log4j.properties.in" in "/opt/zimbra/conf", then you restart zimbra for the changes are made in the file "log4j.properties".
    You should have the same config file "log4j.properties" on your tomcat too.
    So you can activate debug mode on both platform to get as much informations as possible.
    i did that before i had those warning
    log4j:WARN No appenders could be found for logger (zimbra.misc).
    log4j:WARN Please initialize the log4j system properly.
    now it deseappers but the authentication still not working
    this my mailbox.log filemailbox.log

  4. #14
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    Can you instead just give us the part that appear when you test your dev?
    You should also check the log file "/opt/zimbra/log/zmmailboxd.out", and the logs on the server hosting your dev so we can get an error message.

  5. #15
    Join Date
    Feb 2013
    Posts
    23
    Rep Power
    2

    Default

    Quote Originally Posted by tdesorbaix View Post
    Can you instead just give us the part that appear when you test your dev?
    You should also check the log file "/opt/zimbra/log/zmmailboxd.out", and the logs on the server hosting your dev so we can get an error message.
    nothing is appeared i just use println for knowing where the code block it blocks in admin authentication, this is my zmmailboxd.out zmmailboxd.out i develop my app on eclipse under windows 7 using tomcat as local web server

  6. #16
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    Look like you have nothing in zimbra logs, so the problem is occurring on the local web server.
    That is why I told you to check the logs of your tomcat.
    We can't do anything for you if you don't provide us an error message.

  7. #17
    Join Date
    Feb 2013
    Posts
    23
    Rep Power
    2

    Default

    Quote Originally Posted by tdesorbaix View Post
    Look like you have nothing in zimbra logs, so the problem is occurring on the local web server.
    That is why I told you to check the logs of your tomcat.
    We can't do anything for you if you don't provide us an error message.
    there no error in tomcat logs, just mailbox.log this in a new version of mailbox.log if it helps
    Attached Files Attached Files

  8. #18
    Join Date
    Feb 2013
    Posts
    23
    Rep Power
    2

    Default

    why when i try to go to https://192.168.10.203:7071/service/admin/soap on navigator i still get this error:
    HTTP ERROR 405

    Problem accessing /service/admin/soap. Reason:

    HTTP method GET is not supported by this URL
    Powered by Jetty://????? in my application i use POST method and it does't work. i think this is the problem. but how to solve it i don't know

  9. #19
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    ...
    Yes it is normal you get this error when you try to open this url with your navigator, since the navigator send a GET request.
    Are you sure that the credentials you are using are correct?
    You can try to use the credentials stored in the local config instead with the following code :

    SoapProvisioning soapProv = new SoapProvisioning();
    String adminUrl = "https://192.168.10.203:7071/service/admin/soap";
    soapProv.soapSetURI(adminUrl);
    soapProv.soapZimbraAdminAuthenticate();

  10. #20
    Join Date
    Feb 2013
    Posts
    23
    Rep Power
    2

    Default

    Quote Originally Posted by tdesorbaix View Post
    ...
    Yes it is normal you get this error when you try to open this url with your navigator, since the navigator send a GET request.
    Are you sure that the credentials you are using are correct?
    You can try to use the credentials stored in the local config instead with the following code :

    SoapProvisioning soapProv = new SoapProvisioning();
    String adminUrl = "https://192.168.10.203:7071/service/admin/soap";
    soapProv.soapSetURI(adminUrl);
    soapProv.soapZimbraAdminAuthenticate();
    still have the same problem i get the certificate using this class made by one of members of the forum:
    Code:
    package MVC;
    
    import java.io.*;
    import java.net.URL;
    
    import java.security.*;
    import java.security.cert.*;
    
    import javax.net.ssl.*;
    
    public class InstallCert {
    
        public static void main(String[] args) throws Exception {
    	String host;
    	int port;
    	char[] passphrase;
    	args = new String[1];
    	args[0]="192.168.10.203:7071";
    	if ((args.length == 1) || (args.length == 2)) {
    	    String[] c = args[0].split(":");
    	    host = c[0];
    	    port = (c.length == 1) ? 443 : Integer.parseInt(c[1]);
    	    String p = (args.length == 1) ? "changeit" : args[1];
    	    passphrase = p.toCharArray();
    	} else {
    	    System.out.println("Usage: java InstallCert <host>[:port] [passphrase]");
    	    return;
    	}
    //for my windows and java
    	File file = new File("C:\\Program Files\\Java\\jdk1.7.0_21\\jre\\lib\\security\\cacerts");
    //	if (file.isFile() == false) {
    //	    char SEP = File.separatorChar;
    //	   
    //	    File dir = new File(System.getProperty("java.home") + SEP
    //		    + "lib" + SEP + "security");
    //	    file = new File(dir, "jssecacerts");
    //	    if (file.isFile() == false) {
    //		file = new File(dir, "cacerts");
    //	    }
    //	}
    	System.out.println("Loading KeyStore " + file + "...");
    	InputStream in = new FileInputStream(file);
    	KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
    	ks.load(in, passphrase);
    	in.close();
    
    	SSLContext context = SSLContext.getInstance("TLS");
    	TrustManagerFactory tmf =
    	    TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
    	tmf.init(ks);
    	X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];
    	SavingTrustManager tm = new SavingTrustManager(defaultTrustManager);
    	context.init(null, new TrustManager[] {tm}, null);
    	SSLSocketFactory factory = context.getSocketFactory();
    	
    	System.out.println("Opening connection to " + host + ":" + port + "...");
    	SSLSocket socket = (SSLSocket)factory.createSocket(host, port);
    	socket.setSoTimeout(10000);
    	try {
    	    System.out.println("Starting SSL handshake...");
    	    socket.startHandshake();
    	    socket.close();
    	    System.out.println();
    	    System.out.println("No errors, certificate is already trusted");
    	} catch (SSLException e) {
    	    System.out.println();
    	    e.printStackTrace(System.out);
    	}
    
    	X509Certificate[] chain = tm.chain;
    	if (chain == null) {
    	    System.out.println("Could not obtain server certificate chain");
    	    return;
    	}
    
    	BufferedReader reader =
    		new BufferedReader(new InputStreamReader(System.in));
    
    	System.out.println();
    	System.out.println("Server sent " + chain.length + " certificate(s):");
    	System.out.println();
    	MessageDigest sha1 = MessageDigest.getInstance("SHA1");
    	MessageDigest md5 = MessageDigest.getInstance("MD5");
    	for (int i = 0; i < chain.length; i++) {
    	    X509Certificate cert = chain[i];
    	    System.out.println
    	    	(" " + (i + 1) + " Subject " + cert.getSubjectDN());
    	    System.out.println("   Issuer  " + cert.getIssuerDN());
    	    sha1.update(cert.getEncoded());
    	    System.out.println("   sha1    " + toHexString(sha1.digest()));
    	    md5.update(cert.getEncoded());
    	    System.out.println("   md5     " + toHexString(md5.digest()));
    	    System.out.println();
    	}
    
    	System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]");
    	String line = reader.readLine().trim();
    	int k;
    	try {
    	    k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1;
    	} catch (NumberFormatException e) {
    	    System.out.println("KeyStore not changed");
    	    return;
    	}
    
    	X509Certificate cert = chain[k];
    	String alias = host + "-" + (k + 1);
    	ks.setCertificateEntry(alias, cert);
    	
    
    	OutputStream out = new FileOutputStream("C:\\Program Files\\Java\\jdk1.7.0_21\\jre\\lib\\security\\cacerts");
    	ks.store(out, passphrase);
    	out.close();
    
    	System.out.println();
    	System.out.println(cert);
    	System.out.println();
    	System.out.println
    		("Added certificate to keystore 'jssecacerts' using alias '"
    		+ alias + "'");
    	 String gdzie = new String(System.getProperty("java.home//") +   "lib//"   + "security");
    		    System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    		    System.out.println(gdzie);
    		    
        }
        
        private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray();
        
        private static String toHexString(byte[] bytes) {
    	StringBuilder sb = new StringBuilder(bytes.length * 3);
    	for (int b : bytes) {
    	    b &= 0xff;
    	    sb.append(HEXDIGITS[b >> 4]);
    	    sb.append(HEXDIGITS[b & 15]);
    	    sb.append(' ');
    	}
    	return sb.toString();
        }
    
        private static class SavingTrustManager implements X509TrustManager {
    	
    	private final X509TrustManager tm;
    	private X509Certificate[] chain;
    	
    	SavingTrustManager(X509TrustManager tm) {
    	    this.tm = tm;
    	}
        
    	public X509Certificate[] getAcceptedIssuers() {
    	    throw new UnsupportedOperationException();
    	}
        
    	public void checkClientTrusted(X509Certificate[] chain, String authType)
    		throws CertificateException {
    	    throw new UnsupportedOperationException();
    	}
        
    	public void checkServerTrusted(X509Certificate[] chain, String authType)
    		throws CertificateException {
    	    this.chain = chain;
    	    tm.checkServerTrusted(chain, authType);
    	}
          }
              }

Similar Threads

  1. SOAP API authenticate using a zm_auth_token
    By taichimaro in forum Developers
    Replies: 0
    Last Post: 06-20-2011, 08:31 AM
  2. How do I authenticate using port 587
    By spectra in forum Administrators
    Replies: 2
    Last Post: 05-05-2011, 01:31 PM
  3. Error 403 Must Authenticate
    By vmartinez in forum Error Reports
    Replies: 2
    Last Post: 10-08-2008, 02:12 PM
  4. [SOLVED] 403 Must Authenticate
    By vmartinez in forum Administrators
    Replies: 0
    Last Post: 10-08-2008, 10:57 AM
  5. authenticate to OS X server
    By superman in forum Administrators
    Replies: 1
    Last Post: 04-18-2006, 11:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •