private ScoroCode(string appKey, string clientKey, string accessKey) { AuthKey = new SCAuthKey { AppKey = appKey, ClientKey = clientKey, AccessKey = accessKey }; }
public SCAppResponse TryGetAppInfo(SCAuthKey keys) { try { return(GetAppInfo(keys)); } catch (WebException ex) { return((SCAppResponse)RequestExceptionHelper.FillRequestError(ex)); } }
public SCResponse TryLogout(SCAuthKey keys, string sessionId) { try { return(Logout(keys, sessionId)); } catch (WebException ex) { return(RequestExceptionHelper.FillRequestError(ex)); } }
public SCLoginResponse <T> TryLogin <T>(SCAuthKey keys, string email, string password) where T : SCUserInfo { try { return(Login <T>(keys, email, password)); } catch (WebException ex) { return((SCLoginResponse <T>)RequestExceptionHelper.FillRequestError(ex)); } }
public SCResponse TryRegister <T>(SCAuthKey keys, string userName, string email, string password, T additionalInfo = default(T)) { try { return(Register(keys, userName, email, password, additionalInfo)); } catch (WebException ex) { return(RequestExceptionHelper.FillRequestError(ex)); } }
protected SCResponse Logout(SCAuthKey keys, string sessionId) { var url = Host + "/logout"; var values = new Dictionary <string, string>(); values.Add("app", keys.AppKey); values.Add("cli", keys.ClientKey); values.Add("sess", sessionId); return(RequestHelper.Get <SCResponse>(url, values)); }
protected SCAppResponse GetAppInfo(SCAuthKey keys) { var url = Host + "/app"; var values = new Dictionary <string, string>(); values.Add("app", keys.AppKey); values.Add("cli", keys.ClientKey); values.Add("acc", keys.AccessKey); return(RequestHelper.Get <SCAppResponse>(url, values)); }
protected SCLoginResponse <T> Login <T>(SCAuthKey keys, string email, string password) where T : SCUserInfo { var url = Host + "/login"; var values = new Dictionary <string, string>(); values.Add("app", keys.AppKey); values.Add("cli", keys.ClientKey); values.Add("email", email); values.Add("password", password); return(RequestHelper.Get <SCLoginResponse <T> >(url, values)); }
protected SCResponse Register <T>(SCAuthKey keys, string userName, string email, string password, T additionalInfo = default(T)) { var url = Host + "/register"; var values = new Dictionary <string, string>(); values.Add("app", keys.AppKey); values.Add("cli", keys.ClientKey); values.Add("acc", keys.AccessKey); values.Add("username", userName); values.Add("email", email); values.Add("password", password); //values.Add("doc", "{}"); //fix return(RequestHelper.Get <SCResponse>(url, values)); }