Skip to content

Support using Windows authentication (instead of JWT) #154

@ramiabughazaleh

Description

@ramiabughazaleh

Hi.

I have a SignalR client configured with UseDefaultCredentials:

var hubConnection = new HubConnectionBuilder()
   .WithUrl(newHubUri, options =>
   {
       options.UseDefaultCredentials = true;
   })
   .Build();

The SignalR hub server is configured to use Windows authentication:

    // other startup code

    services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
        .AddNegotiate();

    // other startup code

    app.UseAuthentication();
    app.UseAuthorization();

    app.MapHub<MyHub>("/my-hub");

    app.UseSignalRHubSpecification();
    app.UseSignalRHubDevelopmentUI();

    await app.RunAsync();

The SignalR hub is also decorated with [Authorize].

When I use my client to call the SignalR hub, the SignalR hub can successfully retrieve the WindowsIdentity:

    var httpContext = this.Context.GetHttpContext();

    var windowsIdentity = (WindowsIdentity)httpContext.User.Identity;

However, TypedSignalR.Client.DevTools does not seem to support Windows authentication.

The UI correctly detects authorization is required.

However, it requires a JWT.

I expected to be able to use Windows authentication without having to supply a JWT.

Image

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions