Android NTCredentials - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android NTCredentials class.

This code example shows how to use the following methods:
		case BASIC_DIGEST:
			credentials = new UsernamePasswordCredentials(getUsername(),
					getPassword()); 
			break; 
		case NTLM:
			credentials = new NTCredentials(getUsername(), getPassword(),
					getWorkstation(), getDomain()); 
			break; 
		} 
		if (credentials != null)
			credentialProvider.setCredentials(AuthScope.ANY, credentials);
	} 
 
	public boolean isNtlm() { 
		return type == CredentialType.NTLM;
	} 
 
	public void checkAuth(String serverHostname) throws UnknownHostException,
			SmbException, SearchLibException { 
		switch (type) {
5
CodeRank
This code example shows how to use the following methods:
                    this.getUserName(),
                    this.getPassword());
        } 
        else 
        { 
            credentials = new NTCredentials(
                    this.getUserName(),
                    this.getPassword(),
                    this.getProxyHostName(),
                    this.getDomain());
        } 
        return credentials;
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    @Override 
    public String toString() {
        return this.getDomain() + "\\" + this.getUserName()
4
CodeRank
This code example shows how to use the following methods:
        return auth(new UsernamePasswordCredentials(username, password));
    } 
 
    public Executor auth(final String username, final String password,
            final String workstation, final String domain) {
        return auth(new NTCredentials(username, password, workstation, domain));
    } 
 
    public Executor auth(final HttpHost host,
            final String username, final String password) {
        return auth(host, new UsernamePasswordCredentials(username, password));
    } 
 
    public Executor auth(final HttpHost host,
            final String username, final String password,
            final String workstation, final String domain) {
        return auth(host, new NTCredentials(username, password, workstation, domain));
    } 
 
    public Executor clearAuth() { 
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
	private static final String PROXY_PASSWORD= "nY111111";
	private static final String PROXY_WORKSTATION= "isa06";
	private static final String PROXY_DOMAIN= "ulic";
	 
    public static DefaultHttpClient getHttpClient(DefaultHttpClient httpClient){
        NTCredentials credentials = new NTCredentials(PROXY_USERNAME ,PROXY_PASSWORD , PROXY_WORKSTATION, PROXY_DOMAIN);	        
        httpClient.getCredentialsProvider().setCredentials(new AuthScope(PROXY_HOST, PROXY_PORT), credentials);	      
        HttpHost proxy = new HttpHost(PROXY_HOST, PROXY_PORT);
        httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
        return httpClient;
    } 
     
    public static void main(String[] args) {
        try { 
            DefaultHttpClient hc = getHttpClient(new DefaultHttpClient());
            InputStream is = null;
            //循环上面的IP段数组  
            for (int m = 0; m < ip_.length; m++)
                for (int n = 0; n < ip_[0].length; n++)
                    //循环IP段开始爬去数据   
4
CodeRank
This code example shows how to use the following methods:
                    this.getUserName(),
                    this.getPassword());
        } 
        else 
        { 
            credentials = new NTCredentials(
                    this.getUserName(),
                    this.getPassword(),
                    this.getProxyHostName(),
                    this.getDomain());
        } 
        return credentials;
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    @Override 
    public String toString() {
        return this.getDomain() + "\\" + this.getUserName()
4
CodeRank
This code example shows how to use the following methods:

Related Android NTCredentials Questions & Answers:

See Code Examples for Android NTCredentials Methods: