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

Option to extract client connection user id from http header #730

Merged
merged 3 commits into from
Oct 29, 2023

Conversation

FZambia
Copy link
Member

@FZambia FZambia commented Oct 27, 2023

Proposed changes

Possibility to set client_user_id_http_header option which contains a header name from which Centrifugo will try to extract authenticated user ID for client connections based on HTTP transports (all except unidirectional GRPC). This allows using proxies before Centrifugo which can authenticate requests and set user ID as a header.

In this case applications must ensure that they strip such headers coming from clients on proxy level before authenticating request to avoid malicious usage.

Ex.

{
  ..
  "client_user_id_http_header": "X-User-Id"
}

In this case we do not support setting connection expiration and info.

TODO: possibly think a bit on a better option name.

@FZambia FZambia changed the title Option to extract user id from http header Option to extract client connection user id from http header Oct 27, 2023
@FZambia FZambia merged commit 540cda5 into master Oct 29, 2023
4 checks passed
@FZambia FZambia deleted the user_id_http_header branch October 29, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant