Exemple #1
0
        internal static bool LogoutUser()
        {
            var headers = new Dictionary <string, string>();

            headers["X-accessToken"] = AccessToken;
            var httpRequester      = new HttpRequester(BaseServicesUrl);
            var isLogoutSuccessful = httpRequester.Put("users/logout", headers);

            return(isLogoutSuccessful);
        }
Exemple #2
0
        internal static void RegisterUser(string username, string email, string authenticationCode)
        {
            //Validation!!!!!
            //validate username
            //validate email
            //validate authentication code
            //use validation from WebAPI
            var userModel = new UserModel()
            {
                Username = username,
                Email    = email,
                AuthCode = authenticationCode
            };
            var httpRequester = new HttpRequester(BaseServicesUrl);

            var response = httpRequester.Post <UserModel>("users/register", userModel);
        }
Exemple #3
0
        internal static string LoginUser(string username, string authenticationCode)
        {
            //Validation!!!!!
            //validate username
            //validate authentication code
            //use validation from WebAPI
            var userModel = new UserModel()
            {
                Username = username,
                AuthCode = authenticationCode
            };

            var httpRequester = new HttpRequester(BaseServicesUrl);

            var loginResponse = httpRequester
                                .Post <LoginResponseModel>("auth/token", userModel);

            AccessToken = loginResponse.AccessToken;
            return(loginResponse.Username);
        }