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

[sockjs] Obtain REMOTE_USER from connection object #7570

Closed
srbdev opened this issue Aug 3, 2016 · 4 comments
Closed

[sockjs] Obtain REMOTE_USER from connection object #7570

srbdev opened this issue Aug 3, 2016 · 4 comments

Comments

@srbdev
Copy link

srbdev commented Aug 3, 2016

I am using Meteor 1.3.5.1 and have the following setup: Apache acts as a proxy and authenticates a user. Once the user is authenticated, the connection is forwarded to the Meteor app with the REMOTE_USER HTTP header. I have the following piece of code in my server/main.js file:

Meteor.onConnection((connection) => {
  console.log(connection);
});

I see some information but I cannot see the REMOTE_USER value. I read in the documentation that the HTTP headers are whitelisted but it doesn't specify how one would go about editing the whitelist.

@mitar
Copy link
Contributor

mitar commented Aug 3, 2016

There is no way to edit the whitelist, see this pull request: sockjs/sockjs-node#202

@srbdev
Copy link
Author

srbdev commented Aug 3, 2016

@mitar Thank you for letting me know. Do you know of any workaround to expose the desired HTTP headers?

@abernix abernix changed the title Add support for REMOTE_USER HTTP header for Meteor's connection object [sockjs] Obtain REMOTE_USER from connection object Aug 4, 2016
@mitar
Copy link
Contributor

mitar commented Aug 4, 2016

Yes, you make an Ajax request to the Meteor endpoint on the server and then expose this to the rest of the code. This is also safe and secure from the perspective of the cross-origin requests. This packages does exactly this for its headers. It might be interesting to extract this logic into a 3rd party package which then you and others could just use.

@abernix
Copy link
Contributor

abernix commented Oct 3, 2016

If this ever surfaces in SockJS then Meteor can attempt to implement it. Until then this is a SockJS issue.

@abernix abernix closed this as completed Oct 3, 2016
@ghost ghost mentioned this issue Oct 31, 2017
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

No branches or pull requests

3 participants