mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 01:03:01 +08:00
Add authorization for MQTTnet.Server
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user