Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: Basic Auth for Config #519

Closed
mitch-geht-ab opened this issue Jan 4, 2022 · 3 comments
Closed

RFE: Basic Auth for Config #519

mitch-geht-ab opened this issue Jan 4, 2022 · 3 comments

Comments

@mitch-geht-ab
Copy link

mitch-geht-ab commented Jan 4, 2022

Hello,
awesome project and very easy to implement.
Would it also be possible to implement a BASIC Auth. for the Webinterface like tasmota it does?
Because WIFI and MQTT credentials are accessible without any auth.
I know, I know... Basic Auth. isn't that save. It should only be a small obstacle.

BR
Mitch

@jomjol
Copy link
Owner

jomjol commented Jan 4, 2022

Well, this is a frequent request and one should do it either fully or not at all :-).

Unfortunetly I don't have the time to handle this in my free time. It is already part of the feature request list (see #9). Therefore I close this issue.

If you could help with the implemenation, I would really appreacte this.

P.S.: the wifi credentials are not accessible. The wifi.ini is not transfered and accessible via web interface. Therefore you need to have physical access to the sd-card

@jomjol jomjol closed this as completed Jan 4, 2022
@mitch-geht-ab
Copy link
Author

It is already part of the feature request list

ahh I see, sorry, hadn't realized that file. Thougt RFE or Feature Req. would be best placed in the issue list.

If you could help with the implemenation, I would really appreacte this.

I'm not really an embeded developer.
But wouldn't it be enough (theoretically) to use the ref. implementation from espressif for the basic_auth_get_handler, outsource this function to your helper.cpp (with little fixing of user credentials from config file) and put it in front (1. line) of every uri_handler functions (main_rest_handle, sysinfo_handle etc.) in your server_main.cpp?

https://github.com/espressif/esp-idf/blob/master/examples/protocols/http_server/simple/main/main.c#:~:text=esp_err_t-,basic_auth_get_handler,-(httpd_req_t

BR
Mitch

@jomjol
Copy link
Owner

jomjol commented Jan 5, 2022

Most propably you are right. But "wouldn't it be enough" and integrating into a running project means usually 10-20h of working time. At least to my experience :-)
And don't forget the update of the html and configuration handling. But the code you posted could be a good starting point. I'm also not a professionial embedded programmer, so still my hope for some cofighter to implement new features is ongoing :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants