Basic authentication scheme as defined in RFC 2617.
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... | |
String getSchemeName | ( | ) |
basic
Implements AuthScheme.
void processChallenge | ( | final Header | header | ) | throws MalformedChallengeException |
header | the challenge header |
MalformedChallengeException | is thrown if the authentication challenge is malformed |
Reimplemented from AuthSchemeBase.
boolean isComplete | ( | ) |
true
if Basic authorization has been processed, false
otherwise. Implements AuthScheme.
boolean isConnectionBased | ( | ) |
Header authenticate | ( | final Credentials | credentials, |
final HttpRequest | request | ||
) | throws AuthenticationException |
credentials | The set of credentials to be used for athentication |
request | The request being authenticated |
org.apache.http.auth.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 |
Implements AuthScheme.
|
static |
credentials | The credentials to encode. |
charset | The charset to use for encoding the credentials |
proxy |