mirror of
https://github.com/letscontrolit/ArduinoEasy.git
synced 2026-03-03 00:24:02 +01:00
Authentication in C001
This commit is contained in:
@@ -170,6 +170,7 @@
|
||||
#include <Wire.h>
|
||||
#include <SPI.h>
|
||||
#include <SD.h>
|
||||
#include <base64.h>
|
||||
#include <Ethernet.h>
|
||||
#include <EthernetUdp.h>
|
||||
#if FEATURE_MQTT
|
||||
|
||||
@@ -33,11 +33,13 @@ boolean CPlugin_001(byte function, struct EventStruct *event, String& string)
|
||||
String authHeader = "";
|
||||
if ((SecuritySettings.ControllerUser[0] != 0) && (SecuritySettings.ControllerPassword[0] != 0))
|
||||
{
|
||||
// todo base64 encoder;
|
||||
// String auth = SecuritySettings.ControllerUser;
|
||||
// auth += ":";
|
||||
// auth += SecuritySettings.ControllerPassword;
|
||||
// authHeader = "Authorization: Basic " + encoder.encode(auth) + " \r\n";
|
||||
base64 encoder;
|
||||
String auth = SecuritySettings.ControllerUser;
|
||||
auth += ":";
|
||||
auth += SecuritySettings.ControllerPassword;
|
||||
authHeader = F("Authorization: Basic ");
|
||||
authHeader += encoder.encode(auth);
|
||||
authHeader += F(" \r\n");
|
||||
}
|
||||
|
||||
char log[80];
|
||||
|
||||
Reference in New Issue
Block a user