1 /* ====================================================================
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
18 * ====================================================================
24 #include "auth_spnego.h"
30 void serf__encode_auth_header(const char **header, const char *protocol,
31 const char *data, apr_size_t data_len,
34 /* Prefixes the realm_name with a string containing scheme, hostname and port
35 of the connection, for providing it to the application. */
36 const char *serf__construct_realm(peer_t peer,
37 serf_connection_t *conn,
38 const char *realm_name,
41 /** Basic authentication **/
42 apr_status_t serf__init_basic(int code,
45 apr_status_t serf__init_basic_connection(const serf__authn_scheme_t *scheme,
47 serf_connection_t *conn,
49 apr_status_t serf__handle_basic_auth(int code,
50 serf_request_t *request,
51 serf_bucket_t *response,
53 const char *auth_attr,
56 apr_status_t serf__setup_request_basic_auth(peer_t peer,
58 serf_connection_t *conn,
59 serf_request_t *request,
62 serf_bucket_t *hdrs_bkt);
64 /** Digest authentication **/
65 apr_status_t serf__init_digest(int code,
68 apr_status_t serf__init_digest_connection(const serf__authn_scheme_t *scheme,
70 serf_connection_t *conn,
72 apr_status_t serf__handle_digest_auth(int code,
73 serf_request_t *request,
74 serf_bucket_t *response,
76 const char *auth_attr,
79 apr_status_t serf__setup_request_digest_auth(peer_t peer,
81 serf_connection_t *conn,
82 serf_request_t *request,
85 serf_bucket_t *hdrs_bkt);
86 apr_status_t serf__validate_response_digest_auth(const serf__authn_scheme_t *scheme,
89 serf_connection_t *conn,
90 serf_request_t *request,
91 serf_bucket_t *response,
94 #ifdef SERF_HAVE_SPNEGO
95 /** Kerberos authentication **/
96 apr_status_t serf__init_spnego(int code,
99 apr_status_t serf__init_spnego_connection(const serf__authn_scheme_t *scheme,
101 serf_connection_t *conn,
103 apr_status_t serf__handle_spnego_auth(int code,
104 serf_request_t *request,
105 serf_bucket_t *response,
106 const char *auth_hdr,
107 const char *auth_attr,
110 apr_status_t serf__setup_request_spnego_auth(peer_t peer,
112 serf_connection_t *conn,
113 serf_request_t *request,
116 serf_bucket_t *hdrs_bkt);
117 apr_status_t serf__validate_response_spnego_auth(const serf__authn_scheme_t *scheme,
120 serf_connection_t *conn,
121 serf_request_t *request,
122 serf_bucket_t *response,
124 #endif /* SERF_HAVE_SPNEGO */