Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

get token OAuthor from linkedIn ?

$
0
0

hi,

first, you can see the code below:

var client = new HttpClient();
client.BaseAddress = new Uri("https://www.linkedin.com/");
var responseLinkedIn = client.PostAsJsonAsync("uas/oauth2/authorization?response_type=code&client_id=75y56gbk3pcrqh&scope=r_fullprofile%20r_emailaddress%20r_network%20r_contactinfo%20rw_company_admin&state=179898f6-6e67-43ff-a67e-2b9c01eb4cf9&redirect_uri=http%3A%2F%2Flocalhost%3A59108%2Fresume%2Fimportlinkedin", new { }).Result;

the responseLinkedIn variable's type data is System.Net.Http.StreamContent, i don't know how to parse to data that i need ?. i saw it contained a html form which have a authen_otke, that mean, i have to post to linkedIn server again, right ? you can see the data which return as below, the bold code is token var but i can't get it.

{StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
X-Frame-Options: SAMEORIGIN
Vary: Accept-Encoding
X-FS-UUID: 14cabe3ba0f4b713b0bd66b0f02a0000
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Li-Fabric: PROD-ELA4
Strict-Transport-Security: max-age=0
Date: Sat, 10 Jan 2015 06:59:36 GMT
P3P: CP="CAO CUR ADM DEV PSA PSD OUR"
Set-Cookie: _lipt=deleteMe; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
Set-Cookie: leo_auth_token="GST:URcggJ2wTZzwpLKl2XqZ6TcYg9Lm3ZUl7FEoC06C8iRJRZTo-dULzC:1420873176:9bc658c8ccb7a31c9c3a8926e15c71354b67929f"; Version=1; Max-Age=1799; Expires=Sat, 10-Jan-2015 07:29:35 GMT; Path=/
Set-Cookie: sl="delete me"; Version=1; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
Set-Cookie: sl="delete me"; Version=1; Domain=.www.linkedin.com; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
Set-Cookie: s_leo_auth_token="delete me"; Version=1; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
Set-Cookie: visit="v=1&G"; Version=1; Max-Age=63072000; Expires=Mon, 09-Jan-2017 06:59:36 GMT; Path=/
Set-Cookie: lang="v=2&lang=en-us"; Version=1; Domain=linkedin.com; Path=/
Set-Cookie: bcookie="v=2&23d7869f-096f-4dda-88f9-61b2b5d43b21"; domain=.linkedin.com; Path=/; Expires=Mon, 09-Jan-2017 18:37:08 GMT
Set-Cookie: bscookie="v=1&20150110065936b2204bf0-1ceb-4da6-8180-453a9d745e90AQEo-AX7AvmwxRjwClrQ60fQqxF7mKC5"; domain=.www.linkedin.com; Path=/; Secure; Expires=Mon, 09-Jan-2017 18:37:08 GMT; HttpOnly
Set-Cookie: lidc="b=LB54:g=157:u=1:i=1420873176:t=1420959576:s=2069348060"; Expires=Sun, 11 Jan 2015 06:59:36 GMT; domain=.linkedin.com; Path=/
Server: Apache-Coyote/1.1
Pragma: no-cache
Cache-Control: no-store, no-cache
Transfer-Encoding: chunked
Connection: keep-alive
X-Li-Pop: prod-nsg7
X-LI-UUID: FMq+O6D0txOwvWaw8CoAAA==
Content-Language: en-US
Content-Type: text/html; charset=UTF-8
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Length: 17193
}}

Thanks! Laughing


Viewing all articles
Browse latest Browse all 4850

Trending Articles