Other Parts Discussed in Thread: SYSBIOS
Hello Guys,
I am implementing a HTTP Server in my project and I used the excelente stuff provided by Todd Mullanix (Making a HTTP Server with Ti-RTOS). It works fine and Tood is clear in all slides. I am using TI-RTOS 2.16 with NDK 2.25
Now I need to put HTTP Basic Authentication in my server, at the root folder. Following the documentation (Apendix E from spru524h.pdf), I configured the Realm 1 and added a user to this. After that, I added just the index.html file to the root folder. The browser asks for user and password but when I provide the credentials, I receive back the window asking again for the credentials. It seeems like the HTTP Server did not like my credentials.
Below the source code. It is pretty straightforward.
Void AddWebFiles(Void) {
CI_ACCT CA;
int rc;
HANDLE hCfg;
hCfg = CfgNew();
CfgSetDefault(hCfg);
hCfg = CfgGetDefault();
// Creates the Authorization Realm 1
rc = CfgAddEntry(hCfg, CFGTAG_SYSINFO, CFGITEM_SYSINFO_REALM1, 0, 7, (UINT8 *)"REALM1", 0);
strcpy(CA.Username, "admin");
strcpy(CA.Password, "admin");
CA.Flags = CFG_ACCTFLG_CH1; // Adds the user the the Realm 1
rc = CfgAddEntry(hCfg, CFGTAG_ACCT, CFGITEM_ACCT_REALM, 0, sizeof(CI_ACCT), (UINT8 *)&CA, 0);
// All files in the root folder are protected by authentication
efs_createfile("%R%", 4, (UINT8 *)&securityRealm);
efs_createfile("index.html", INDEX_SIZE, (UINT8 *)INDEX);
}
Any advice will be welcome
Best Regards
Leandro