Package org.rssowl.core.connection

Examples of org.rssowl.core.connection.ICredentials


    String getRealm() {
      return fRealm;
    }

    ICredentials toCredentials() {
      return new ICredentials() {
        public String getDomain() {
          return ""; //$NON-NLS-1$
        }

        public String getPassword() {
View Full Code Here


        news.setInReplyTo(value.substring(0, endOfFirstId + 1));
    }
  }

  private void setupAuthentication(URI link, NNTPClient client) throws CredentialsException, IOException {
    ICredentials authCredentials = Owl.getConnectionService().getAuthCredentials(link, null);
    if (authCredentials != null)
      client.authenticate(authCredentials.getUsername(), authCredentials.getPassword());
  }
View Full Code Here

            canceled = true;
            return;
          }

          /* Obtain Google Account Credentials */
          ICredentials credentials = Owl.getConnectionService().getAuthCredentials(URI.create(SyncUtils.GOOGLE_LOGIN_URL), null);
          if (credentials == null) {
            canceled = true;
            return;
          }

          /* Obtain Auth Token */
          String googleAuthToken = SyncUtils.getGoogleAuthToken(credentials.getUsername(), credentials.getPassword(), true, monitor);

          /* Return on Cancellation */
          if (monitor.isCanceled() || Controller.getDefault().isShuttingDown()) {
            canceled = true;
            return;
View Full Code Here

      try {
        URI siteUri = new URI(site);
        ICredentialsProvider credentialsProvider = Owl.getConnectionService().getCredentialsProvider(siteUri);
        if (credentialsProvider != null) {
          credentialsProvider.setAuthCredentials(new ICredentials() {
            public String getUsername() {
              return username;
            }

            public String getPassword() {
View Full Code Here

  private CredentialsModelData loadCredentials(URI link, String realm) throws CredentialsException {
    if (StringUtils.isSet(link.getScheme())) {
      ICredentialsProvider credentialsProvider = fConService.getCredentialsProvider(link);
      if (credentialsProvider != null) {
        ICredentials authCredentials = credentialsProvider.getPersistedAuthCredentials(link, realm);
        if (authCredentials != null)
          return new CredentialsModelData(authCredentials.getUsername(), authCredentials.getPassword(), link, realm);
      }
    }

    return null;
  }
View Full Code Here

    String getRealm() {
      return fRealm;
    }

    ICredentials toCredentials() {
      return new ICredentials() {
        public String getDomain() {
          return ""; //$NON-NLS-1$
        }

        public String getPassword() {
View Full Code Here

        fPreferences.putBoolean(DefaultPreferences.REMEMBER_PASSWORD, rememberPassword);

      final String username = fUsername.getText();
      final String password = fPassword.getText();

      ICredentials credentials = new ICredentials() {
        public String getDomain() {
          return null;
        }

        public String getPassword() {
View Full Code Here

    /* Otherwise return super */
    return super.createButtonBar(parent);
  }

  private void preload() {
    ICredentials authCredentials = null;
    try {

      /* First try with full URI */
      if (fCredProvider != null)
        authCredentials = fCredProvider.getAuthCredentials(fLink, fRealm);

      /* Second try with Host / Port / Realm */
      if (fCredProvider != null && fRealm != null && authCredentials == null)
        authCredentials = fCredProvider.getAuthCredentials(URIUtils.normalizeUri(fLink, true), fRealm);
    } catch (CredentialsException e) {
      Activator.getDefault().getLog().log(e.getStatus());
    }

    if (authCredentials != null) {
      String username = authCredentials.getUsername();
      String password = authCredentials.getPassword();

      if (StringUtils.isSet(username)) {
        fUsername.setText(username);
        fUsername.selectAll();
      }
View Full Code Here

    InputStream inS = null;
    boolean isCanceled = false;
    try {

      /* Obtain Google Credentials */
      ICredentials credentials = Owl.getConnectionService().getAuthCredentials(URI.create(SyncUtils.GOOGLE_LOGIN_URL), null);
      if (credentials == null)
        return null;

      /* Load Google Auth Token */
      String authToken = SyncUtils.getGoogleAuthToken(credentials.getUsername(), credentials.getPassword(), false, monitor);
      if (authToken == null)
        authToken = SyncUtils.getGoogleAuthToken(credentials.getUsername(), credentials.getPassword(), true, monitor);

      /* Return on Cancellation */
      if (monitor.isCanceled() || !StringUtils.isSet(authToken))
        return null;

View Full Code Here

    return equivalentItemLists;
  }

  private String getGoogleApiToken(IProgressMonitor monitor) throws ConnectionException {
    ICredentialsProvider provider = Owl.getConnectionService().getCredentialsProvider(URI.create(SyncUtils.GOOGLE_LOGIN_URL));
    ICredentials creds = provider.getAuthCredentials(URI.create(SyncUtils.GOOGLE_LOGIN_URL), null);
    if (creds == null)
      throw new AuthenticationRequiredException(null, Status.CANCEL_STATUS);

    return SyncUtils.getGoogleApiToken(creds.getUsername(), creds.getPassword(), monitor);
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.connection.ICredentials

Copyright © 2018 www.massapicom. 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.