Examples of ICredentials


Examples of org.rssowl.core.connection.ICredentials

    /* 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

Examples of org.rssowl.core.connection.ICredentials

    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

Examples of org.rssowl.core.connection.ICredentials

    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

Examples of org.rssowl.core.connection.ICredentials

      if (e.getRealm() == null)
        throw e;

      /* Try to load credentials using Host / Port / Realm */
      URI normalizedUri = URIUtils.normalizeUri(link, true);
      ICredentials authCredentials = Owl.getConnectionService().getAuthCredentials(normalizedUri, e.getRealm());

      /* Credentials based on Host / Port / Realm provided */
      if (authCredentials != null) {

        /* Store for plain URI too */
 
View Full Code Here

Examples of org.rssowl.core.connection.ICredentials

      throw new ConnectionException(Activator.getDefault().createErrorStatus(e.getMessage(), e));
    }
  }

  private void setupAuthentication(URI link, String realm, HttpClient client, HttpMethodBase method) throws URIException, CredentialsException {
    ICredentials authCredentials = Owl.getConnectionService().getAuthCredentials(link, realm);
    if (authCredentials != null) {
      client.getParams().setAuthenticationPreemptive(true);

      /* Require Host */
      String host = method.getURI().getHost();

      /* Create the UsernamePasswordCredentials */
      NTCredentials userPwCreds = new NTCredentials(authCredentials.getUsername(), authCredentials.getPassword(), host, (authCredentials.getDomain() != null) ? authCredentials.getDomain() : ""); //$NON-NLS-1$

      /* Authenticate to the Server */
      client.getState().setCredentials(AuthScope.ANY, userPwCreds);
      method.setDoAuthentication(true);
    }
View Full Code Here

Examples of org.rssowl.core.connection.ICredentials

    /* Require credentials provider */
    ICredentialsProvider credentialsProvider = internalGetCredentialsProvider(link);

    /* Retrieve Credentials */
    ICredentials credentials = credentialsProvider.getAuthCredentials(link, realm);
    return credentials;
  }
View Full Code Here

Examples of org.rssowl.core.connection.ICredentials

  private String handleAuthentication(boolean refresh, IProgressMonitor monitor) throws ConnectionException {

    /* Obtain Google Credentials */
    URI googleLoginUri = URI.create(SyncUtils.GOOGLE_LOGIN_URL);
    ICredentialsProvider provider = Owl.getConnectionService().getCredentialsProvider(googleLoginUri);
    ICredentials credentials = provider.getAuthCredentials(googleLoginUri, null);
    if (credentials == null)
      throw new AuthenticationRequiredException(null, Status.CANCEL_STATUS);

    /* Obtain Google Authentication Token */
    String token = SyncUtils.getGoogleAuthToken(credentials.getUsername(), credentials.getPassword(), refresh, monitor);
    if (token == null)
      throw new AuthenticationRequiredException(null, Status.CANCEL_STATUS);

    return token;
  }
View Full Code Here

Examples of org.rssowl.core.connection.auth.ICredentials

   * @throws CredentialsException In case of an error while retrieving
   * Credentials for the Feed.
   */
  public ICredentials getAuthCredentials(URL url) throws CredentialsException {
    if (fCredentialsProvider != null) {
      ICredentials credentials = fCredentialsProvider.getAuthCredentials(url);
      if (credentials != null)
        return credentials;
    }
    return null;
  }
View Full Code Here

Examples of org.rssowl.core.connection.auth.ICredentials

      e = e1;
    }

    assertNotNull(e);

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

      public String getPassword() {
View Full Code Here

Examples of org.rssowl.core.connection.auth.ICredentials

   * @see org.rssowl.core.connection.auth.ICredentialsProvider#getAuthCredentials(java.net.URL)
   */
  @SuppressWarnings( { "nls", "unused" })
  public ICredentials getAuthCredentials(URL url) throws CredentialsException {
    if (url.toExternalForm().equals("http://www.rssowl.org/rssowl2dg/tests/connection/authrequired/feed_rdf.xml"))
      return new ICredentials() {
        public String getUsername() {
          return "bpasero";
        }

        public String getPassword() {
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.