http_server_auth.h
Go to the documentation of this file.
1 /**
2  * @file http_server_auth.h
3  * @brief HTTP authentication
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _HTTP_SERVER_AUTH_H
30 #define _HTTP_SERVER_AUTH_H
31 
32 //Dependencies
33 #include "http/http_server.h"
34 
35 //C++ guard
36 #ifdef __cplusplus
37  extern "C" {
38 #endif
39 
40 //HTTP authentication related functions
42  const char_t *password, HttpAuthMode mode);
43 
45 size_t httpAddAuthenticateField(HttpConnection *connection, char_t *output);
46 
48  char_t *output, size_t *length);
49 
51  const char_t *nonce, const char_t *nc);
52 
53 //C++ guard
54 #ifdef __cplusplus
55  }
56 #endif
57 
58 #endif
#define HttpServerContext
Definition: http_server.h:292
char char_t
Definition: compiler_port.h:41
size_t httpAddAuthenticateField(HttpConnection *connection, char_t *output)
Format WWW-Authenticate header field.
error_t httpVerifyNonce(HttpServerContext *context, const char_t *nonce, const char_t *nc)
Nonce verification.
HTTP server (HyperText Transfer Protocol)
error_t httpGenerateNonce(HttpServerContext *context, char_t *output, size_t *length)
Nonce generation.
bool_t httpCheckPassword(HttpConnection *connection, const char_t *password, HttpAuthMode mode)
Password verification.
error_t
Error codes.
Definition: error.h:40
#define HttpConnection
Definition: http_server.h:296
uint8_t mode
Definition: sntp_client.h:143
uint8_t value[]
Definition: dtls_misc.h:141
uint8_t length
Definition: dtls_misc.h:140
int bool_t
Definition: compiler_port.h:47
void httpParseAuthorizationField(HttpConnection *connection, char_t *value)
Parse Authorization header field.
HttpAuthMode
HTTP authentication schemes.
Definition: http_server.h:320