简体   繁体   中英

Configure mongoose for Anonymous Authentication

I have embedded mongoose in a C++ application used for develop and test web systems. When these web systems are running locally there is no need for security. It should run like an anonymous authentication system. I didn't find any way to do this in mongoose so I rewrote the “authorize” method to

static int authorize(struct mg_connection *, struct file *) {
   return 1;
}

Normally the authorize method validates user. Is there another way to configure mongoose to run like anonymous? And is there a problem rewriting the authorize method like this.

Authorization function you've mentioned looks for .htpasswd file inside respective directory. If .htpasswd file is not there, authorization succeeds. So you don't need to make any changes at all, just don't create .htpasswd files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM