How to authorize WebSocket session in C #?
How to authorize the current session of WebSocket with C #? Does anyone have any examples?
Best Answers
-
You just need to call the Authorize https://developers.binary.com/api/#authorize call before using the calls that require authorization.
Here are some changes to theMain()
routine of our sample code https://developers.binary.com/demos/ that does that. First it Authorizes using a token then it uses theget_limits
call which requires read token access https://developers.binary.com/api/#get_limits.If you are not aware you or your users create tokens after logging into binary.com here https://www.binary.com/en/user/security/api_tokenws.html
static void Main(string[] args) { var bws = new BinaryWS(); bws.Connect().Wait(); string auth = "{\"authorize\" : \"replace with your token \" }"; bws.SendRequest(auth).Wait(); bws.StartListen(); string data = "{\"get_limits\": 1}"; bws.SendRequest(data).Wait(); Console.ReadLine(); }
Answers
US the developing public say thanks that it can become that easy !!