Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSE authentication #57

Open
knopki opened this issue Jan 19, 2023 · 0 comments
Open

SSE authentication #57

knopki opened this issue Jan 19, 2023 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@knopki
Copy link
Contributor

knopki commented Jan 19, 2023

The current SSE endpoint implementation (/stream) lacks user authentication.

Instead of authentication by user, a filter by message is used. And that's fine, but it's message-by-message authentication. The request is not authenticated/authorized.

Current implementation flaws:
The client can connect with the wrong credentials. It just doesn't get any events. Why? No one knows, the client is just in a "connected" state.

A connection can be opened by an anonymous client. A bad agent can open millions of sse endpoint connections. This causes free ports to run out. Valid clients cannot connect.

Proposed solution:
Add feature to an upstream express-bff package: ability to set onConnect callback. Check authentication in this callback. Close connection for unauthenticated/unauthorized users.

@blokhin blokhin added the bug Something isn't working label Jan 19, 2023
@blokhin blokhin added the enhancement New feature or request label Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants