Azure SignalR AccessToken is very large

Viewed 355

I am using azure signalR and the accesstoken generated is very large as adgroup list the user is present is pretty big. Am I missing something? Can someone help me.

Detailed Explanation: I created a push application using azure signalR. I am facing a error while opening a websocket in signalr.js at line

var webSocket = new WebSocket(url)

Error says url is too long. Url is very long as the access token is attached to it. And access token is very large as it contains all the ad groups list in which I am member of.

1 Answers

This is a known issue we're thinking about. You can exclude claims using the claims provider on ServiceOptions.

Just change the call to AddAzureSignalR to reduce some of the claims using a LINQ statement to filter out the ones you don't need to round trip to the service.

.AddAzureSignalR(options => {
    options.ClaimsProvider = context => {
        return context.User.Claims.Where(...);
    };
});
Related