Comments (5)
Can you please submit a pr
from oauth2.
Excuse me, what is "pr"?
from oauth2.
Pull request, also do you have any documentation for the supported versions and api changes?
from oauth2.
I don't have documentation.
I tried to get information about the user using VkClient in the same way as I received information using GoogleClient. But there was an exception.
Then I decided to make requests to the api myself:
UriBuilder accessUriBuilder = new UriBuilder("https://oauth.vk.com/access_token");
NameValueCollection accessQueries = HttpUtility.ParseQueryString(accessUriBuilder.Query);
accessQueries["client_id"] = provider.ClientId;
accessQueries["client_secret"] = provider.SecretKey;
accessQueries["redirect_uri"] = redirect.ToString();
accessQueries["grant_type"] = "authorization_code";
accessQueries["code"] = code;
accessUriBuilder.Query = accessQueries.ToString();
HttpClient httpClient = new HttpClient();
var accessResponseValue = await httpClient
.GetStringAsync(accessUriBuilder.Uri.ToString())
.ConfigureAwait(false);
var accessResponse = JObject.Parse(accessResponseValue);
string access_token = accessResponse.GetValue("access_token").Value<string>();
string user_id = accessResponse.GetValue("user_id").Value<string>();
string email = accessResponse.GetValue("email").Value<string>();
UriBuilder userInfoUriBuilder = new UriBuilder("https://api.vk.com/method/users.get");
NameValueCollection userInfoQueries = HttpUtility.ParseQueryString(userInfoUriBuilder.Query);
userInfoQueries["v"] = "5.74";
userInfoQueries["access_token"] = access_token;
userInfoQueries["user_ids"] = user_id;
userInfoQueries["fields"] = "first_name,last_name,has_photo,photo_max_orig,sex,bdate,phone";
userInfoUriBuilder.Query = userInfoQueries.ToString();
var userInfoResponseValue = await httpClient
.GetStringAsync(userInfoUriBuilder.Uri.ToString())
.ConfigureAwait(false);
var userInfoResponse = JObject.Parse(userInfoResponseValue);
As a result, I received an error message:
Invalid request: versions below 5.81 are deprecated. Version param should be passed as "v". "version" param is invalid and not supported. For more information go to https://vk.com/dev/constant_version_updates
Fixed 5.74 to 5.81 and it worked! (5.131 is actual)
from oauth2.
Thanks for that, if you want to submit a pull request to change the version that would be greatly appreciated.
from oauth2.
Related Issues (20)
- Yahoo email retriever social API
- Library use old CommonServiceLocator version HOT 3
- documention HOT 1
- Instagram Problem HOT 7
- Can Support Amazon (Login in Amazon)? HOT 1
- Initialize Client from stored token HOT 1
- Example config for .net core HOT 10
- Using OAuth2 in winforms project HOT 1
- Update GitHub OAuth Client HOT 4
- Support for HOT 1
- Help Wanted - Twitter - I can't authenticate you HOT 1
- Exception of type 'OAuth2.Client.UnexpectedResponseException' was thrown. when retrieving User info from Linked In HOT 2
- Integration for Microsoft Azure Login APIs HOT 4
- 谷歌登录有bug HOT 1
- New Refresh Tokens are not saved when using OAuth2Client.GetCurrentTokenAsync HOT 7
- Any plans to support RestSharp v107+? HOT 2
- What is the LICENSE for this library? HOT 1
- Unable to resolve 'OAuth2 (>= 0.10.3)' for 'net8.0-windows'. HOT 1
- OneDrive or DropBox? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oauth2.