TCPIP_HTTP_FileAuthenticate Function

C

uint8_t TCPIP_HTTP_FileAuthenticate(
    HTTP_CONN_HANDLE connHandle, 
    uint8_t* cFile
);

Description

This function is implemented by the application developer. Its function is to determine if a file being requested requires authentication to view. The user name and password, if supplied, will arrive later with the request headers, and will be processed at that time.

Return values 0x80 - 0xff indicate that authentication is not required, while values from 0x00 - 0x79 indicate that a user name and password are required before proceeding. While most applications will only use a single value to grant access and another to require authorization, the range allows multiple "realms" or sets of pages to be protected, with different credential requirements for each.

The return value of this function is saved for the current connection and can be read using TCPIP_HTTP_CurrentConnectionIsAuthorizedGet(). It will be available to future callbacks, including TCPIP_HTTP_UserAuthenticate and any of the TCPIP_HTTP_GetExecute, TCPIP_HTTP_PostExecute, or TCPIP_HTTP_Pring_varname callbacks.

Preconditions

None.

Parameters

ParametersDescription
connHandleHTTP connection handle.
cFileThe name of the file being requested.

Returns

  • <= 0x79 - Valid authentication is required.

  • >= 0x80 - access is granted for this connection.

Remarks

This function may NOT write to the TCP buffer.