basicauth.c File Reference

Implements HTTP basic authentication methods. More...

#include "platform.h"
#include <limits.h>
#include "internal.h"
#include "base64.h"
Include dependency graph for basicauth.c:

Go to the source code of this file.

Defines

#define _BASIC_BASE   "Basic "

Functions

char * MHD_basic_auth_get_username_password (struct MHD_Connection *connection, char **password)
int MHD_queue_basic_auth_fail_response (struct MHD_Connection *connection, const char *realm, struct MHD_Response *response)

Detailed Description

Implements HTTP basic authentication methods.

Author:
Amr Ali
Matthieu Speder

Definition in file basicauth.c.


Define Documentation

#define _BASIC_BASE   "Basic "

Beginning string for any valid Basic authentication header.

Definition at line 33 of file basicauth.c.

Referenced by MHD_basic_auth_get_username_password().


Function Documentation

char* MHD_basic_auth_get_username_password ( struct MHD_Connection connection,
char **  password 
)

Get the username and password from the basic authorization header sent by the client

Parameters:
connection The MHD connection structure
password a pointer for the password
Returns:
NULL if no username could be found, a pointer to the username if found

Definition at line 45 of file basicauth.c.

References _BASIC_BASE, BASE64Decode(), MHD_Connection::daemon, MHD_HEADER_KIND, MHD_HTTP_HEADER_AUTHORIZATION, MHD_lookup_connection_value(), and NULL.

Here is the call graph for this function:

int MHD_queue_basic_auth_fail_response ( struct MHD_Connection connection,
const char *  realm,
struct MHD_Response response 
)

Queues a response to request basic authentication from the client

Parameters:
connection The MHD connection structure
realm the realm presented to the client
Returns:
MHD_YES on success, MHD_NO otherwise

Definition at line 110 of file basicauth.c.

References MHD_add_response_header(), MHD_HTTP_HEADER_WWW_AUTHENTICATE, MHD_HTTP_UNAUTHORIZED, MHD_queue_response(), and MHD_YES.

Here is the call graph for this function:


Generated on 27 Sep 2012 for GNU libmicrohttpd by  doxygen 1.6.1