• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
BasicScheme Class Reference
Inheritance diagram for BasicScheme:
RFC2617Scheme AuthSchemeBase AuthScheme

Description

Basic authentication scheme as defined in RFC 2617.

Author
Remy Maucherat
Rodney Waldhoff
Jeff Dever
Ortwin Glueck
Sean C. Sullivan
Adrian Sutton
Mike Bowler
Oleg Kalnichevski
Since
4.0

Notice

The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.

/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Public Member Functions

 BasicScheme ()
 Default constructor for the basic authetication scheme.
 
String getSchemeName ()
 Returns textual designation of the basic authentication scheme. More...
 
void processChallenge (final Header header) throws MalformedChallengeException
 Processes the Basic challenge. More...
 
boolean isComplete ()
 Tests if the Basic authentication process has been completed. More...
 
boolean isConnectionBased ()
 Returns false. More...
 
Header authenticate (final Credentials credentials, final HttpRequest request) throws AuthenticationException
 Produces basic authorization header for the given set of com.good.gd.apache.http.auth.Credentials. More...
 
- Public Member Functions inherited from RFC2617Scheme
 RFC2617Scheme ()
 Default constructor for RFC2617 compliant authetication schemes.
 
String getParameter (final String name)
 Returns authentication parameter with the given name, if available. More...
 
String getRealm ()
 Returns authentication realm. More...
 
- Public Member Functions inherited from AuthSchemeBase
boolean isProxy ()
 Returns true if authenticating against a proxy, false otherwise. More...
 

Static Public Member Functions

static Header authenticate (final Credentials credentials, final String charset, boolean proxy)
 Returns a basic Authorization header value for the given com.good.gd.apache.http.auth.Credentials and charset. More...
 

Additional Inherited Members

- Protected Member Functions inherited from RFC2617Scheme
Map< String, String > getParameters ()
 Returns authentication parameters map. More...
 

Member Function Documentation

◆ getSchemeName()

String getSchemeName ( )
Returns
basic

Implements AuthScheme.

◆ processChallenge()

void processChallenge ( final Header  header) throws MalformedChallengeException
Parameters
headerthe challenge header
Exceptions
MalformedChallengeExceptionis thrown if the authentication challenge is malformed

Reimplemented from AuthSchemeBase.

◆ isComplete()

boolean isComplete ( )
Returns
true if Basic authorization has been processed, false otherwise.

Implements AuthScheme.

◆ isConnectionBased()

boolean isConnectionBased ( )

Basic authentication scheme is request based.

Returns
false.

Implements AuthScheme.

◆ authenticate() [1/2]

Header authenticate ( final Credentials  credentials,
final HttpRequest  request 
) throws AuthenticationException
Parameters
credentialsThe set of credentials to be used for athentication
requestThe request being authenticated
Exceptions
org.apache.http.auth.InvalidCredentialsExceptionif authentication credentials are not valid or not applicable for this authentication scheme
AuthenticationExceptionif authorization string cannot be generated due to an authentication failure
Returns
a basic authorization string

Implements AuthScheme.

◆ authenticate() [2/2]

static Header authenticate ( final Credentials  credentials,
final String  charset,
boolean  proxy 
)
static
Parameters
credentialsThe credentials to encode.
charsetThe charset to use for encoding the credentials
proxy
Returns
a basic authorization header