Examples of PasswordAuthentication


Examples of javax.mail.PasswordAuthentication

  {
    final String protocol = getRequestingProtocol();

    final String userName = properties.getProperty("mail." + protocol + ".user", properties.getProperty("mail.user"));
    final String password = properties.getProperty("mail." + protocol + ".password", properties.getProperty("mail.password"));
    return new PasswordAuthentication(userName, password);
  }
View Full Code Here

Examples of javax.mail.PasswordAuthentication

  {
    protected PasswordAuthentication getPasswordAuthentication()
    {
      if (mUser != null)
      {
        return new PasswordAuthentication(mUser, mPassword);
      }
      else
      {
        return null;
      }
View Full Code Here

Examples of javax.mail.PasswordAuthentication

                 pluginConfig));
        p = props.getProperty("mail.smtp.connectiontimeout");
        this.smtpConnectionTimeout = new Integer(p).intValue();

      // Pass "this" for SMTP authentication with Authenticator
      this.authentication = new PasswordAuthentication(getUser(), this.xbUri.getPassword());
      this.session = Session.getDefaultInstance(props, this);
      this.isInitialized = true;
     
      // Setup asynchronous sending thread for outgoing emails
      this.asyncSendQueueSizeMax = glob.get("asyncSendQueueSizeMax",
View Full Code Here

Examples of javax.mail.PasswordAuthentication

      try {
         this.xbUri = new XbUri(this.pop3Url);
         if (this.xbUri.getPassword() != null) {
            this.props.setProperty("mail.smtp.auth", "true"); //Indicate that authentication is required at pop3 server
            this.authentication = new PasswordAuthentication(this.xbUri.getUser(), this.xbUri.getPassword());
         }
      } catch (URISyntaxException e) {
         throw new XmlBlasterException(glob,
               ErrorCode.RESOURCE_CONFIGURATION_ADDRESS, "Pop3Driver",
               "Your URI '" + this.pop3Url +
View Full Code Here

Examples of javax.mail.PasswordAuthentication

         synchronized (this) {
            if (this.session == null) { // In such a case we should better throw an exception (the session should be initialized?!)
               Thread.dumpStack();
               if (this.xbUri != null && this.xbUri.getPassword() != null) {
                  this.props.setProperty("mail.smtp.auth", "true"); //Indicate that authentication is required at pop3 server
                  this.authentication = new PasswordAuthentication(this.xbUri.getUser(), this.xbUri.getPassword());
               }
               this.session = Session.getInstance(this.props, this);
            }
         }
      }
View Full Code Here

Examples of javax.mail.PasswordAuthentication

public class SilentAuthenticator extends Authenticator {
  private PasswordAuthentication oPwdAuth;

  public SilentAuthenticator(String sUserName, String sAuthStr) {
    oPwdAuth = new PasswordAuthentication(sUserName, sAuthStr);
  }
View Full Code Here

Examples of javax.mail.PasswordAuthentication

     * Called when password authentication is needed.
     * @return a password authentication
     */
    @Override
    public PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(username, password);
    }
View Full Code Here

Examples of javax.mail.PasswordAuthentication

    final Properties properties = Database.query(propertySupplier);
    if (properties != null) {
      Session session = Session.getInstance(properties,
          new javax.mail.Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
              return new PasswordAuthentication(properties
                  .getProperty("mail.smtp.user", ""),
                  properties.getProperty(
                      "mail.smtp.password", ""));
            }
          });
View Full Code Here

Examples of javax.mail.PasswordAuthentication

   }

   protected void startService() throws Exception
   {
      // Setup password authentication
      final PasswordAuthentication pa = new PasswordAuthentication(getUser(), getPassword());
      Authenticator a = new Authenticator()
      {
         protected PasswordAuthentication getPasswordAuthentication()
         {
            return pa;
View Full Code Here

Examples of javax.mail.PasswordAuthentication

  /**
   * @see javax.mail.Authenticator#getPasswordAuthentication()
   */
  protected PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(this.smtpUser, this.smtpPwd);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.