Note that there are some explanatory texts on larger screens.

plurals
  1. POInvalid Credential with XOAuth2 for Gmail
    primarykey
    data
    text
    <p>Recently, I am trying to get e-mails from Gmail, using XOAuth2 protocol. Especially, I am using "OAuth2Authenticator.java" from <a href="https://code.google.com/p/google-mail-oauth2-tools/downloads/list" rel="nofollow">https://code.google.com/p/google-mail-oauth2-tools/downloads/list</a>.</p> <p>But, I always get an invalid credential error like the follwoing:</p> <p>A1 NO [ALERT] Invalid credentials (Failure) Exception in thread "main" javax.mail.AuthenticationFailedException: [ALERT] Invalid credentials (Failure) at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:566) at javax.mail.Service.connect(Service.java:265)</p> <p>Before reading, due to the limitation of putting a link, I cannot write "httoo://" so that please think of that this http header is front of some url information.</p> <p>Before posting this question, I think I looked most of the articles about this one. Many articles are about using OAuth1.0 (deprecated) But, I still cannot figure out how I can make it work with OAuth2 &amp; XOAuth2. I appreciate any suggestion/helps.</p> <p>The following is the steps I am taking:</p> <ol> <li><p>get an access token through OAuth2 with the scope of mail.google.com/</p></li> <li><p>just put this access token &amp; gmail account (e.g. test@gmail.com) into "OAuth2Authenticator.java".</p></li> </ol> <p>After this procedure, I always get invalid credential.</p> <p>The interesting stuff is that I can get unread mails through Feed URL (i.e. <a href="https://mail.google.com/mail/feed/atom" rel="nofollow">https://mail.google.com/mail/feed/atom</a>) which is specified in Google OAuth2.0 Playground.</p> <p>This indicates that I am sure that I get the correct access token. But, does not work at all for IMAP with this sample code.</p> <p>Actually, the scope "mail.google.com/" is not included in the list of Google OAuth2.0 Playground.</p> <p>For getting access token for XOAuth2, is there any other special way to get access token?</p> <p>For the official page about XOAuth2, we need to use base64 to encode the access token. But, I think the sample code is doing this procedure.</p> <p>Also, SMTP of this sample did not work at all. But, after changing the properties, I could make it work. Is this code old? But, unfortunately, what I need is IMAP. But, after trying setting some different/new properties, IMAP does not work at all....</p> <p>I am stuck on this problem for a long time. So, I posted this question. I really appreciate any suggestion/helps.</p> <p>Regards</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload