# mcorest_set_basic_auth

> Set Basic HTTP authentication parameters for the server instance.

### For an overview see page Web Services

### Prototype

      MCO_RET mcorest_set_basic_auth(mcorest_h rest,
                            const char *realm,
                            const char *username,
                            const char *password );

### Arguments

rest | Server instance handle
realm | The authentication realm (up to 15 characters)
username | The authentication username (up to 15 characters)
password | The authentication password (up to 31 characters)

### Description

> This function sets the Basic HTTP authentication parameters for the server instance. All arguments must be non-NULL. Furthermore, the `username` and the `password` cannot be empty. Repeated calls to this function will overwrite previously set parameters.

> (Note that this function requires that HTTP authentication be enabled in `mcoews` as well.)

### Return Codes

MCO_S_OK = 0 | Success
MCO_E_REST_* | Any of the Web Services Error Codes

### Files

Header file:
mcorest.h
Source file:
mcorest.c
Library:
libmcorest.a