Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: net/http/http_auth_handler.h

Issue 6525035: Invalidate credentials if the server rejects them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify auth handlers for basic and digest Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_H_ 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_H_
6 #define NET_HTTP_HTTP_AUTH_HANDLER_H_ 6 #define NET_HTTP_HTTP_AUTH_HANDLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // is required. For Digest authentication it may also mean that the previous 44 // is required. For Digest authentication it may also mean that the previous
45 // attempt used a stale nonce (and nonce-count) and that a new attempt should 45 // attempt used a stale nonce (and nonce-count) and that a new attempt should
46 // be made with a different nonce provided in the challenge. 46 // be made with a different nonce provided in the challenge.
47 // 47 //
48 // |challenge| must be non-NULL and have already tokenized the 48 // |challenge| must be non-NULL and have already tokenized the
49 // authentication scheme, but none of the tokens occuring after the 49 // authentication scheme, but none of the tokens occuring after the
50 // authentication scheme. 50 // authentication scheme.
51 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( 51 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
52 HttpAuth::ChallengeTokenizer* challenge) = 0; 52 HttpAuth::ChallengeTokenizer* challenge) = 0;
53 53
54 // Determine whether any cached credentials should be invalidated
55 //
56 // This method is called after this handler was used to generate a
57 // preemptive authentication response and the server responded with
58 // a challenge. The response should indicate whether the cached
59 // credentials used to generate the preemptive authentication should
60 // be invalidated.
61 //
62 // |challenge| must be non-NULL. The authentication scheme can be
63 // assumed to have been verified to match this handler.
64 virtual bool ShouldInvalidateRejectedAuth(
65 HttpAuth::ChallengeTokenizer* challenge);
66
54 // Generates an authentication token, potentially asynchronously. 67 // Generates an authentication token, potentially asynchronously.
55 // 68 //
56 // When |username| and |password| are NULL, the default credentials for 69 // When |username| and |password| are NULL, the default credentials for
57 // the currently logged in user are used. |AllowsDefaultCredentials()| MUST be 70 // the currently logged in user are used. |AllowsDefaultCredentials()| MUST be
58 // true in this case. 71 // true in this case.
59 // 72 //
60 // |request|, |callback|, and |auth_token| must be non-NULL. 73 // |request|, |callback|, and |auth_token| must be non-NULL.
61 // 74 //
62 // The return value is a net error code. 75 // The return value is a net error code.
63 // If |OK| is returned, |*auth_token| is filled in with an authentication 76 // If |OK| is returned, |*auth_token| is filled in with an authentication
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 void OnGenerateAuthTokenComplete(int rv); 199 void OnGenerateAuthTokenComplete(int rv);
187 void FinishGenerateAuthToken(); 200 void FinishGenerateAuthToken();
188 201
189 CompletionCallback* original_callback_; 202 CompletionCallback* original_callback_;
190 CompletionCallbackImpl<HttpAuthHandler> wrapper_callback_; 203 CompletionCallbackImpl<HttpAuthHandler> wrapper_callback_;
191 }; 204 };
192 205
193 } // namespace net 206 } // namespace net
194 207
195 #endif // NET_HTTP_HTTP_AUTH_HANDLER_H_ 208 #endif // NET_HTTP_HTTP_AUTH_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698