fuzesedu / java-gmail-imap

Automatically exported from code.google.com/p/java-gmail-imap
0 stars 0 forks source link

gimap oauth error #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
use lib version 
 * gimap-1.4.6
 * javax.mail-1.4.6
(https://maven.java.net/content/repositories/snapshots/ <-- Anywhere in the 
snapshot can not be found)

according http://code.google.com/p/google-mail-oauth2-tools/ link.

          Properties props = new Properties();
      props.put("mail.store.protocol", "gimaps");
      props.put("mail.gimaps.sasl.enable", "true");
      props.put("mail.gimaps.sasl.mechanisms", "XOAUTH2");
      //mail." + name + ".sasl.authorizationid
      props.put(OAuth2SaslClientFactory.OAUTH_TOKEN_PROP, oauthToken);

      Session session = Session.getDefaultInstance(props, null);
      session.setDebug(debug);
      GmailSSLStore store = (GmailSSLStore) session.getStore("gimaps");
      store.connect(host, port, userEmail, "");

The following error occurs.

java.lang.NoSuchMethodException: 
com.sun.mail.imap.protocol.IMAPSaslAuthenticator.<init>(com.sun.mail.imap.protoc
ol.IMAPProtocol, java.lang.String, java.util.Properties, boolean, 
java.io.PrintStream, java.lang.String) 

Original issue reported on code.google.com by jabs...@gmail.com on 20 Feb 2013 at 12:03

GoogleCodeExporter commented 8 years ago
Hmmh, I'm also using 
http://code.google.com/p/google-mail-oauth2-tools/wiki/JavaSampleCode but I'm 
getting:

Caused by: javax.mail.AuthenticationFailedException: Empty username or password.
    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:661)
    at com.sun.mail.gimap.GmailStore.protocolConnect(GmailStore.java:84)
    at javax.mail.Service.connect(Service.java:288)

Is there a workaround to get GmailMessages with the help of OAuth?

Original comment by tableYou...@gmail.com on 25 Jun 2013 at 8:04

GoogleCodeExporter commented 8 years ago
Hmmh, strange now it seems to work (using 1.4.7 for both)

Original comment by tableYou...@gmail.com on 25 Jun 2013 at 8:43

GoogleCodeExporter commented 8 years ago
If you use the version 1.4.7 resolved.

Original comment by jabs...@bluedigm.com on 26 Jun 2013 at 1:23