OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GSSAPI_POSIX_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ |
6 #define NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ | 6 #define NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // Generates an authentication token. | 248 // Generates an authentication token. |
249 // The return value is an error code. If it's not |OK|, the value of | 249 // The return value is an error code. If it's not |OK|, the value of |
250 // |*auth_token| is unspecified. | 250 // |*auth_token| is unspecified. |
251 // |spn| is the Service Principal Name of the server that the token is | 251 // |spn| is the Service Principal Name of the server that the token is |
252 // being generated for. | 252 // being generated for. |
253 // If this is the first round of a multiple round scheme, credentials are | 253 // If this is the first round of a multiple round scheme, credentials are |
254 // obtained using |*credentials|. If |credentials| is NULL, the default | 254 // obtained using |*credentials|. If |credentials| is NULL, the default |
255 // credentials are used instead. | 255 // credentials are used instead. |
256 int GenerateAuthToken(const AuthCredentials* credentials, | 256 int GenerateAuthToken(const AuthCredentials* credentials, |
257 const std::string& spn, | 257 const std::string& spn, |
258 std::string* auth_token); | 258 std::string* auth_token, |
| 259 const CompletionCallback& callback); |
259 | 260 |
260 // Delegation is allowed on the Kerberos ticket. This allows certain servers | 261 // Delegation is allowed on the Kerberos ticket. This allows certain servers |
261 // to act as the user, such as an IIS server retrieiving data from a | 262 // to act as the user, such as an IIS server retrieiving data from a |
262 // Kerberized MSSQL server. | 263 // Kerberized MSSQL server. |
263 void Delegate(); | 264 void Delegate(); |
264 | 265 |
265 private: | 266 private: |
266 int GetNextSecurityToken(const std::string& spn, | 267 int GetNextSecurityToken(const std::string& spn, |
267 gss_buffer_t in_token, | 268 gss_buffer_t in_token, |
268 gss_buffer_t out_token); | 269 gss_buffer_t out_token); |
269 | 270 |
270 std::string scheme_; | 271 std::string scheme_; |
271 gss_OID gss_oid_; | 272 gss_OID gss_oid_; |
272 GSSAPILibrary* library_; | 273 GSSAPILibrary* library_; |
273 std::string decoded_server_auth_token_; | 274 std::string decoded_server_auth_token_; |
274 ScopedSecurityContext scoped_sec_context_; | 275 ScopedSecurityContext scoped_sec_context_; |
275 bool can_delegate_; | 276 bool can_delegate_; |
276 }; | 277 }; |
277 | 278 |
278 } // namespace net | 279 } // namespace net |
279 | 280 |
280 #endif // NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ | 281 #endif // NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ |
OLD | NEW |