private static UserInfo GetUserData(string accessToken) { var uri = CreateUserInfoUri(accessToken); var response = OAuthHelpers.GetObjectFromAddress(uri); return(new UserInfo { Id = response.id, UserName = String.Format("{0} {1}", response.first_name, response.last_name) }); }
private static UserInfo GetUserData(string userId) { var address = CreateUserInfoUri(userId); var response = OAuthHelpers.GetObjectFromAddress(address); var user = response.response[0]; return(new UserInfo { Id = user.uid, UserName = String.Format("{0} {1}", user.first_name, user.last_name) }); }
private static UserInfo GetUserData(string accessToken) { var address = CreateUserDataUri(accessToken); var response = OAuthHelpers.GetObjectFromAddress(address); var url = new Uri(response.siteStandardProfileRequest.url.ToString()); var id = HttpUtility.ParseQueryString(url.Query).Get("id"); return(new UserInfo { Id = id, UserName = String.Format("{0} {1}", response.firstName, response.lastName) }); }
private static UserInfo GetUserData(string accessToken) { var uri = OAuthHelpers.BuildUri(ApiUrl, "oauth2/v1/userinfo", new NameValueCollection { { "access_token", accessToken } }); var response = OAuthHelpers.GetObjectFromAddress(uri); return(new UserInfo { Id = response.id, UserName = response.name }); }
private string GetAccessToken(HttpContextBase context) { var address = CreateAccessTokenUri(context); return(OAuthHelpers.GetObjectFromAddress(address).access_token); }
private string GetAccessToken(string code) { var address = CreateBuildUri(code); return(OAuthHelpers.GetObjectFromAddress(address).user_id); }