can me find nice resources integrating linkedin authentication on windows app development ? links, source codes, video tutorial links , youtube links helpful.
here sample code https://code.msdn.microsoft.com/windowsapps/linkedin-oauth-20-example-408dd568 :
private async task getauthorizecode() { var url = "https://www.linkedin.com/uas/oauth2/authorization?response_type=code" + "&client_id=" + _consumerkey + "&scope=" + uri.escapedatastring(_scope) + "&state=state" + "&redirect_uri=" + uri.escapedatastring(_callbackurl); log(url); var starturi = new uri(url); var enduri = new uri(_callbackurl); webauthenticationresult war = await webauthenticationbroker.authenticateasync( webauthenticationoptions.none, starturi, enduri); switch (war.responsestatus) { case webauthenticationstatus.success: { // grab access_token , oauth_verifier var response = war.responsedata; idictionary<string, string> keydictionary = new dictionary<string, string>(); var qsplit = response.split('?'); foreach (var kvp in qsplit[qsplit.length - 1].split('&')) { var kvpsplit = kvp.split('='); if (kvpsplit.length == 2) { keydictionary.add(kvpsplit[0], kvpsplit[1]); } } _authorizationcode = keydictionary["code"]; break; } case webauthenticationstatus.usercancel: { log("http error returned authenticateasync() : " + war.responseerrordetail.tostring()); break; } default: case webauthenticationstatus.errorhttp: log("error returned authenticateasync() : " + war.responsestatus.tostring()); break; } }
Comments
Post a Comment