Android APIs
Added in API level 1
Deprecated since API level 22
public class

BasicScheme

extends RFC2617Scheme
java.lang.Object
   ↳ org.apache.http.impl.auth.AuthSchemeBase
     ↳ org.apache.http.impl.auth.RFC2617Scheme
       ↳ org.apache.http.impl.auth.BasicScheme

This class was deprecated in API level 22.
Please use openConnection() instead. Please visit this webpage for further details.

Class Overview

Basic authentication scheme as defined in RFC 2617.

Summary

Public Constructors
BasicScheme()
Default constructor for the basic authetication scheme.
Public Methods
Header authenticate(Credentials credentials, HttpRequest request)
Produces basic authorization header for the given set of Credentials.
static Header authenticate(Credentials credentials, String charset, boolean proxy)
Returns a basic Authorization header value for the given Credentials and charset.
String getSchemeName()
Returns textual designation of the basic authentication scheme.
boolean isComplete()
Tests if the Basic authentication process has been completed.
boolean isConnectionBased()
Returns false.
void processChallenge(Header header)
Processes the Basic challenge.
[Expand]
Inherited Methods
From class org.apache.http.impl.auth.RFC2617Scheme
From class org.apache.http.impl.auth.AuthSchemeBase
From class java.lang.Object
From interface org.apache.http.auth.AuthScheme

Public Constructors

public BasicScheme ()

Added in API level 1

Default constructor for the basic authetication scheme.

Public Methods

public Header authenticate (Credentials credentials, HttpRequest request)

Added in API level 1

Produces basic authorization header for the given set of Credentials.

Parameters
credentials The set of credentials to be used for athentication
request The request being authenticated
Returns
  • a basic authorization string
Throws
InvalidCredentialsException if authentication credentials are not valid or not applicable for this authentication scheme
AuthenticationException if authorization string cannot be generated due to an authentication failure

public static Header authenticate (Credentials credentials, String charset, boolean proxy)

Added in API level 1

Returns a basic Authorization header value for the given Credentials and charset.

Parameters
credentials The credentials to encode.
charset The charset to use for encoding the credentials
Returns
  • a basic authorization header

public String getSchemeName ()

Added in API level 1

Returns textual designation of the basic authentication scheme.

Returns
  • basic

public boolean isComplete ()

Added in API level 1

Tests if the Basic authentication process has been completed.

Returns
  • true if Basic authorization has been processed, false otherwise.

public boolean isConnectionBased ()

Added in API level 1

Returns false. Basic authentication scheme is request based.

Returns
  • false.

public void processChallenge (Header header)

Added in API level 1

Processes the Basic challenge.

Parameters
header the challenge header
Throws
MalformedChallengeException is thrown if the authentication challenge is malformed