c# - Isolate users in signalR hub by domain -


i have web application single iis installation (this isn't changing), has dynamic collection of subdomains. each subdomain has own user accounts.

the problem running when run signalr on it, treats sub-domains same domain, users happen have same user name each others messages.

this causing me security violation issue between domain accounts.

so far best guess solutions have different levels of risks , problems.

  1. each user gets own group, build group name sub-domain name + user name.
    1. list item minimizes risk of collision doesn't remove it.
    2. using guid domain name, , reserving first n-characters guid reduces risk further, each user online have group formed.
  2. on owin start, spin new hub represents each domain.
    1. each time add subdomain, have restart application add new hub. right now, don't have add subdomains dns supporting wildcard, , host header in iis blank. works except lack of subdomain awareness in signalr.
  3. build custom hub class, makes client collection domain aware, rest of application.
    1. this seems cleanest, far, time consuming. poses highest risk of bugs, since have compose larger collection of qa tests beyond tdd unit testing.
  4. last option, don't use signalr, build own long poll api.
    1. this hardest 1 accept, since highest bandwidth , exposed process. basic survey of our target users shows using websocket supporting browsers, why purposely increase bandwidth or create new latency.

to see failure, grab simple chat demo @ asp.net/signalr, , run on local computer under 2 different browsers (ff , ie core tests), , have 1 call http:\localhost , other call http:\yourcomputername. need iis not iis express proper test.

my 2 cents: build own implementation of iuseridprovider, there should easy inspect each request , generate unique user id across multiple domains return, way signalr know whom associate each request correctly. it'd simple , not invasive solution. can check here more detail.


Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -