Add authorization for MQTTnet.Server

This commit is contained in:
Christian Kratky
2019-06-09 00:10:26 +02:00
parent 1c004ead6d
commit ffc1d950da
27 changed files with 480 additions and 113 deletions
@@ -0,0 +1,10 @@
def handle_authenticate(context):
"""
This function is invoked whenever a user tries to access protected HTTP resources.
This function must exist and return a proper value. Otherwise the request is denied.
"""
username = context["username"]
password = context["password"]
context["is_authenticated"] = True # Change this to _False_ in case of invalid credentials.