Skip to content

Authentication of Websocket connection #1732

@Zaixu

Description

@Zaixu

As the title. How is this supposed to work with HotChocolate? I cant seem to wrap my head around it.
As websockets doesnt send headers. If the connection cant be stopped, data can be sniffed.

Am i missing something here? Seing as authorize attribute will only return unauthorized, as there is no bearer token. I could send a parameter in with websocket, but it looks to me hotchocolate is taking care of the whole connection in its middleware, where there is no auth handling.

`

[ExtendObjectType(Name = "Query")]
public class OrganizationQueries
{
    public IQueryable<OrganizationDTO> GetOrganizations([Service] IMapper mapper, [Service]DatabaseContext dbContext) {
        return mapper.ProjectTo<OrganizationDTO>(dbContext.Organizations);
    }
}

`

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions