Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
432 stars 184 forks source link

Using ClaimTypeList & IdToken in SignalRConnectionInfoInput (isolated-process functions) #1792

Closed msirkovsky-moodys closed 1 year ago

msirkovsky-moodys commented 1 year ago

Hi,

is there any documentation or example of how to use ClaimTypeList & IdToken from SignalRConnectionInfoAttribute in isolated worker process functions?

I want to add claims from my JWT token to the SignalR access token that is generated when the negotiate function is called.

The code to illustrate my intentions:

public string Negotiate(
        [HttpTrigger(AuthorizationLevel.Function)] HttpRequestData req,
        [SignalRConnectionInfoInput(HubName = "hubName", UserId = "{headers.user}", 
        ClaimTypeList = new []{"scope"}, 
        IdToken = ???
        )] string connectionInfo)
    {
        return connectionInfo;
    }

Thanks.

Y-Sindo commented 1 year ago

Hi @msirkovsky-moodys , the IdToken is usually a binding expression which refers to your JWT token, such as {query.token} . We will improve our doc to address the issue.

Y-Sindo commented 1 year ago

The doc SignalR input binding attributes has been updated.