AnsweredAssumed Answered

About HTTP Server Authentication

Question asked by doron2006 on Feb 16, 2013
Latest reply on Apr 16, 2013 by pbanta

I'm trying to get Basic Authentication working with MQX 4.0 and CW10.3 I followed the advice from HTTP Server Authentication

but I can´t understand point 2 of the explanation:

2. Add to my project authentification callback function like this:


int _http_auth_internal (HTTPD_SESSION_STRUCT* session){  // check user login  if (strncmp(session->request.auth, your_login, YOUR_LOGIN_SIZE) != 0)    return 1;  // check user password  if (strncmp(session->request.authPasswd, your_pass, YOUR_PASSWORD_SIZE) != 0)    return 1;  // all good  return 0;}


And attach this callback with



HTTPD_SET_PARAM_AUTH_FN(server, _http_auth_internal);


I appreciate any sample code that clear that concept. Thank you in advance Doron.