Last post Dec 04, 2014 01:18 PM by osmiumbin
Dec 04, 2014 09:41 AM|osmiumbin|LINK
Hello, i am facing with the following problem:
from the website. When a user logs in my website a session state variable is set to authenticate him every time he is making a request. How can i know from the console app if the user that made the request (via signalr) is really the one authenticated on the
website (his web app session state is a match) ?
Dec 04, 2014 01:18 PM|osmiumbin|LINK
After some thought i came up with the following solution but i hope there is a better one out there.
1. User visits the website and authenticates via forms authentication.
2. In the same time a connection has been established with the console app via
3. After a successful authentication the web server generates a token for that user,
saves it to the database and then sends it to the user.
5. The method look up in the database for the token and gets the UserId associated with that token. The token is then removed from the database.
6. It then maps the UserId to the signalr ConnectionId.
That way for each request from a ConnectionId the console app is able to identify the user that made it.
I'll just accept this as answer but if you have a better solution please do tell :)