Ejemplo n.º 1
0
        public string GetUserName()
        {
            if (WebRequestHelper.AccessToken == null)
            {
                throw new NotLoggedInException();
            }

            HttpWebRequest request = WebRequestHelper.CreateRequest(HttpVerb.Get, "api/Account/v1/GetUserName");

            dynamic userNameObj = WebRequestHelper.GetDynamicResponse(request);

            return(userNameObj.ToString());
        }
Ejemplo n.º 2
0
        public string GetTokenForUser(string userName)
        {
            CheckAccessToken();

            HttpWebRequest request = WebRequestHelper.CreateRequest(HttpVerb.Get,
                                                                    "api/Account/v1/CreateTokenForUser?userName=" + userName);

            dynamic token = WebRequestHelper.GetDynamicResponse(request);

            return(token.ToString());
        }