Open DilLip-Chowdary-Codes opened 5 months ago
The access token generated in SignalR Serverless Quick start with python negotiate
function is for SignalR client connection only. Specifically, the aud
claim in the access token should be the same as your HTTP request URL, not including the trailing slash and query parameters. , that is https://<our-service>.service.signalr.net/api/v1/hubs/<hub_name>/connections/{connection_id}
.
BTW, you could use SignalR function extensions in Python to send messages to a connection, like this:
def main(req: func.HttpRequest, signalROutput: func.Out[str]) -> func.HttpResponse:
message = req.get_json()
signalROutput.set(json.dumps({
#message will only be sent to this user ID
'connectionId': 'connectionId',
'target': 'newMessage',
'arguments': [ message ]
}))
@Y-Sindo Thanks for the update it helped us :heart:
BTW, you could use SignalR function extensions in Python to send messages to a connection, like this:
But we need to send message as part of our business logic, so we can't choose this.
Describe the bug
While we're trying to send a message to specific connectionId, we're receiving the 401 status code
More Details:
Code:
FYI Access token was generated using the SignalR Serverless Quick start with python
Exceptions (if any)
We're getting
b''
as API response and401
as status code.Further technical details
REST API Version: V1