private void getUserInfo(VKontakteSocialUserInfo vkUserInfo) { dynamic responseCommon = WebClient.GetJsonAsDynamic(GETUSERINFO_BASEURL, this, HTTPRequestMethod.GET, new Dictionary <string, string>() { { USERINFO_USERID_PARAMNAME, vkUserInfo.ID.ToString() }, { USERINFO_FIELDS_PARAMNAME, USERINFO_FIELDS_PARAMVALUE }, { ACCESSTOKEN_PARAMNAME, vkUserInfo.AccessToken } }); dynamic responseObj = responseCommon.response[0]; vkUserInfo.LoginState = SocialLoginState.LoggedIn; vkUserInfo.FirstName = responseObj[USERINFO_FIRSTNAME_PARAMNAME]; vkUserInfo.LastName = responseObj[USERINFO_LASTNAME_PARAMNAME]; vkUserInfo.Nickname = responseObj[USERINFO_NICKNAME_PARAMNAME]; vkUserInfo.Photo = responseObj[USERINFO_PHOTO_PARAMNAME]; }
protected override void DoObtainTokens(SocialUserInfo userInfo, JSONDataMap request, string returnPageURL) { var code = request[ACCESSTOKEN_CODE_PARAMNAME].AsString(); if (code.IsNullOrWhiteSpace()) { throw new NFXException(StringConsts.ARGUMENT_ERROR + GetType().Name + ".GetUserInfo(request should contain code)"); } VKontakteSocialUserInfo vkUserInfo = userInfo as VKontakteSocialUserInfo; string returnURL = PrepareReturnURLParameter(returnPageURL); dynamic accessTokenObj = getAccessTokenObj(code, returnURL); vkUserInfo.AccessToken = accessTokenObj[ACCESSTOKEN_PARAMNAME]; vkUserInfo.ID = (accessTokenObj[ACCESSTOKEN_USERID_PARAMNAME]).ToString(); }
private void getUserInfo(VKontakteSocialUserInfo vkUserInfo) { dynamic responseCommon = WebClient.GetJsonAsDynamic(GETUSERINFO_BASEURL, this, HTTPRequestMethod.GET, new Dictionary<string, string>() { {USERINFO_USERID_PARAMNAME, vkUserInfo.ID.ToString()}, {USERINFO_FIELDS_PARAMNAME, USERINFO_FIELDS_PARAMVALUE}, {ACCESSTOKEN_PARAMNAME, vkUserInfo.AccessToken} }); dynamic responseObj = responseCommon.response[0]; vkUserInfo.LoginState = SocialLoginState.LoggedIn; vkUserInfo.FirstName = responseObj[USERINFO_FIRSTNAME_PARAMNAME]; vkUserInfo.LastName = responseObj[USERINFO_LASTNAME_PARAMNAME]; vkUserInfo.Nickname = responseObj[USERINFO_NICKNAME_PARAMNAME]; vkUserInfo.Photo = responseObj[USERINFO_PHOTO_PARAMNAME]; }