///<Summary> ///Creates a trading session, obtaining session tokens for subsequent API access. ///<p> /// Please note that region-specific <a href=/loginrestrictions>login restrictions</a> may apply. ///</p> ///@param authenticationRequest Client login credentials ///@return Client summary account information ///</Summary> public async Task <IgResponse <dto.endpoint.auth.session.v2.AuthenticationResponse> > authenticate(dto.endpoint.auth.session.v2.AuthenticationRequest authenticationRequest) { return(await _igRestService.RestfulService <dto.endpoint.auth.session.v2.AuthenticationResponse>("/gateway/deal/session", HttpMethod.Post, "2", _conversationContext, authenticationRequest)); }
///<Summary> ///Creates a trading session, obtaining session tokens for subsequent API access. ///<p> /// Please note that region-specific <a href="/loginrestrictions">login restrictions</a> may apply. ///</p> ///@param authenticationRequest Client login credentials ///@return Client summary account information ///</Summary> public async Task <IgResponse <AuthenticationResponse> > Authenticate(AuthenticationRequest authenticationRequest) { var result = await _igRestService.RestfulService <AuthenticationResponse>("/gateway/deal/session", HttpMethod.Post, "3", _conversationContext, authenticationRequest, false, false); _igRestService.SessionHandler.SetToken(result.Response.oauthToken); _ = await _igRestService.RestfulService <AuthenticationResponse>("/gateway/deal/session?fetchSessionTokens=true", HttpMethod.Get, "1", _conversationContext, null, true, true); return(result); }