internal static IRequestShim Make(string resource, RestMethod method, D7UserSession sess, string usr, string pwd) { var req = new RequestShim(resource, method); req.UserName = usr; req.Password = pwd; req.CsrfToken = sess.token; req.Cookies.Add(sess.session_name, sess.sessid); return req; }
private async Task<D7UserSession> GetUserSession(IClientShim client, D7UserSession usr, CancellationToken cancelToken) { var req = RequestFactory.Make(URL.Api_SystemConnect, RestMethod.Post, usr, _userName, _password); req.UserName = _userName; req.Password = _password; var sess = await client.Send<D7UserSession>(req, cancelToken); sess.token = usr.token; sess.BaseURL = client.BaseUrl; return sess; }
public RequestFactory(D7UserSession userSession, string usr, string pwd) { this._sess = userSession; this._userName = usr; this._password = pwd; }