Search in sources :

Example 1 with BasicSchemeFactory

use of org.apache.http.impl.auth.BasicSchemeFactory in project robovm by robovm.

the class DefaultHttpClient method createAuthSchemeRegistry.

@Override
protected AuthSchemeRegistry createAuthSchemeRegistry() {
    AuthSchemeRegistry registry = new AuthSchemeRegistry();
    registry.register(AuthPolicy.BASIC, new BasicSchemeFactory());
    registry.register(AuthPolicy.DIGEST, new DigestSchemeFactory());
    return registry;
}
Also used : BasicSchemeFactory(org.apache.http.impl.auth.BasicSchemeFactory) AuthSchemeRegistry(org.apache.http.auth.AuthSchemeRegistry) DigestSchemeFactory(org.apache.http.impl.auth.DigestSchemeFactory)

Example 2 with BasicSchemeFactory

use of org.apache.http.impl.auth.BasicSchemeFactory in project platform_external_apache-http by android.

the class DefaultHttpClient method createAuthSchemeRegistry.

@Override
protected AuthSchemeRegistry createAuthSchemeRegistry() {
    AuthSchemeRegistry registry = new AuthSchemeRegistry();
    registry.register(AuthPolicy.BASIC, new BasicSchemeFactory());
    registry.register(AuthPolicy.DIGEST, new DigestSchemeFactory());
    return registry;
}
Also used : BasicSchemeFactory(org.apache.http.impl.auth.BasicSchemeFactory) AuthSchemeRegistry(org.apache.http.auth.AuthSchemeRegistry) DigestSchemeFactory(org.apache.http.impl.auth.DigestSchemeFactory)

Example 3 with BasicSchemeFactory

use of org.apache.http.impl.auth.BasicSchemeFactory in project apex-core by apache.

the class WebServicesClient method initAuth.

public static void initAuth(ConfigProvider configuration) {
    // Setting up BASIC and DIGEST auth
    setupUserPassAuthScheme(AuthScheme.BASIC, AuthSchemes.BASIC, new BasicSchemeFactory(), configuration);
    setupUserPassAuthScheme(AuthScheme.DIGEST, AuthSchemes.DIGEST, new DigestSchemeFactory(), configuration);
    // Adding kerberos standard auth
    setupHttpAuthScheme(AuthSchemes.KERBEROS, new KerberosSchemeFactory(), AuthScope.ANY, DEFAULT_TOKEN_CREDENTIALS);
    authRegistry = registryBuilder.build();
}
Also used : BasicSchemeFactory(org.apache.http.impl.auth.BasicSchemeFactory) KerberosSchemeFactory(org.apache.http.impl.auth.KerberosSchemeFactory) DigestSchemeFactory(org.apache.http.impl.auth.DigestSchemeFactory)

Example 4 with BasicSchemeFactory

use of org.apache.http.impl.auth.BasicSchemeFactory in project XobotOS by xamarin.

the class DefaultHttpClient method createAuthSchemeRegistry.

@Override
protected AuthSchemeRegistry createAuthSchemeRegistry() {
    AuthSchemeRegistry registry = new AuthSchemeRegistry();
    registry.register(AuthPolicy.BASIC, new BasicSchemeFactory());
    registry.register(AuthPolicy.DIGEST, new DigestSchemeFactory());
    return registry;
}
Also used : BasicSchemeFactory(org.apache.http.impl.auth.BasicSchemeFactory) AuthSchemeRegistry(org.apache.http.auth.AuthSchemeRegistry) DigestSchemeFactory(org.apache.http.impl.auth.DigestSchemeFactory)

Example 5 with BasicSchemeFactory

use of org.apache.http.impl.auth.BasicSchemeFactory in project calcite-avatica by apache.

the class AvaticaCommonsHttpClientImpl method setUsernamePassword.

@Override
public void setUsernamePassword(AuthenticationType authType, String username, String password) {
    this.credentials = new UsernamePasswordCredentials(Objects.requireNonNull(username), Objects.requireNonNull(password));
    this.credentialsProvider = new BasicCredentialsProvider();
    credentialsProvider.setCredentials(AuthScope.ANY, credentials);
    RegistryBuilder<AuthSchemeProvider> authRegistryBuilder = RegistryBuilder.create();
    switch(authType) {
        case BASIC:
            authRegistryBuilder.register(AuthSchemes.BASIC, new BasicSchemeFactory());
            break;
        case DIGEST:
            authRegistryBuilder.register(AuthSchemes.DIGEST, new DigestSchemeFactory());
            break;
        default:
            throw new IllegalArgumentException("Unsupported authentiation type: " + authType);
    }
    this.authRegistry = authRegistryBuilder.build();
}
Also used : BasicCredentialsProvider(org.apache.http.impl.client.BasicCredentialsProvider) BasicSchemeFactory(org.apache.http.impl.auth.BasicSchemeFactory) AuthSchemeProvider(org.apache.http.auth.AuthSchemeProvider) DigestSchemeFactory(org.apache.http.impl.auth.DigestSchemeFactory) UsernamePasswordCredentials(org.apache.http.auth.UsernamePasswordCredentials)

Aggregations

BasicSchemeFactory (org.apache.http.impl.auth.BasicSchemeFactory)5 DigestSchemeFactory (org.apache.http.impl.auth.DigestSchemeFactory)5 AuthSchemeRegistry (org.apache.http.auth.AuthSchemeRegistry)3 AuthSchemeProvider (org.apache.http.auth.AuthSchemeProvider)1 UsernamePasswordCredentials (org.apache.http.auth.UsernamePasswordCredentials)1 KerberosSchemeFactory (org.apache.http.impl.auth.KerberosSchemeFactory)1 BasicCredentialsProvider (org.apache.http.impl.client.BasicCredentialsProvider)1