-
1. Re: Using oauth2 for smtp mail in Wildfly 10
ctomc Jul 7, 2016 5:00 AM (in response to cbensemann)Looking at the docs of the javamail impl we are using https://java.net/projects/javamail/pages/OAuth2
I don't see a way how to do this.
Maybe you could report a bug in their tracker Components for javamail
-
2. Re: Using oauth2 for smtp mail in Wildfly 10
bs11 Oct 31, 2016 6:42 PM (in response to ctomc)The problem is that the OAuth2 protocol requires that a new access token be supplied on a regular basis. JavaMail doesn't handle generation of access tokens; that's left to the application. That means that you can't hardwire the "password" (access token, in this case) into the application configuration. The application needs to detect when a new access token is needed, e.g., by catching AuthenticationFailedException, or by using an Authenticator to supply the access token on demand. The method to generate a new access token from a refresh token also varies from service to service, so the application needs to include the correct technique for the service it is using. And of course the application needs to manage and protect the refresh token to ensure the security of the account.