mandrewcito / signalrcore

SignalR Core python client
https://mandrewcito.github.io/signalrcore/
MIT License
115 stars 53 forks source link

Connecting to Azure SignalR managed service seems impossible. #94

Open Waebs opened 1 year ago

Waebs commented 1 year ago

It is apparently impossible to connect to the Azure SignalR managed service.

We tried with ,

HubConnectionBuilder()
            .with_url(
                config.get("(wss://qantio-client-sdk-messages.service.signalr.net/)"),
                options={
                    "access_token_factory": lambda: TOKEN,
                    "headers": {
                        # "Authorization": "Bearer " + TOKEN,
                        # "key": KEY,
                        # "access_key": KEY,
                        # "AcessKey": KEY,
                        # "AuthType": "azure.msi",
                        # "ClientId": CLIENT_ID,
                    },
                },
            )

In all the cases we receive a 403,

  File "signalrcore\transport\websockets\websocket_transport.py", line 105, in negotiate
    raise HubError(
signalrcore.hub.errors.HubError: 403

With DEBUG on,

2022-11-24 15:40:42,203 - SignalRCoreClient - DEBUG - Handler registered started ReceiveMessage
2022-11-24 15:40:42,204 - SignalRCoreClient - DEBUG - Handler registered started SendMessage
2022-11-24 15:40:42,204 - SignalRCoreClient - DEBUG - Starting connection ...
2022-11-24 15:40:42,204 - SignalRCoreClient - DEBUG - auth function result _redacted_
2022-11-24 15:40:42,206 - SignalRCoreClient - DEBUG - Connection started
2022-11-24 15:40:42,206 - SignalRCoreClient - DEBUG - Negotiate url:https://_redacted_.service.signalr.net/negotiate
2022-11-24 15:40:42,288 - SignalRCoreClient - DEBUG - Response status code403
2022-11-24 15:40:42,289 - SignalRCoreClient - WARNING - AuthHubConnection
2022-11-24 15:40:42,289 - SignalRCoreClient - WARNING - 403

Has anyone managed to connect Azure SignalR with signalrcore ?

Thx for Help

CameronVetter commented 1 year ago

Months later, and found myself here as well after trying the same things, any ideas @mandrewcito ?