If you are using WebSharper.Owin.WebSocket then In the WebSocket Agent you have reference to a WebSocketClient through which you can get the user's Context and UserSession.

1
2
3
4
5
6
let MessageAgent : Agent<'S2C, 'C2S> =
	fun client ->
    	let us = client.Context.UserSession
        // do something with the session
        fun mesage ->
        	// handle the messages

So the best way to handle this in my opinion is to have an RPC function for handling the user credentials to log them in via the UserSession and then you can use the session in the websocket for authentication.

By on 7/7/2016 12:52 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper