LinkedIn REST API authentication suddenly stopped working Android Emulator -
i using linkedin rest api user's linkedin details , working until today(for past 1 month).i getting basic details name email only.even working till half of today , throwing error,
caused by: com.google.code.linkedinapi.client.oauth.linkedinoauthserviceexception: oauth.signpost.exception.oauthcommunicationexception: communication service provider failed: https://api.linkedin.com/uas/oauth/requesttoken @ com.google.code.linkedinapi.client.oauth.linkedinoauthserviceimpl.getoauthrequesttoken(linkedinoauthserviceimpl.java:180) @ in.techchefs.talktemple.login.linkedinasynctask.doinbackground(linkedinasynctask.java:45) @ in.techchefs.talktemple.login.linkedinasynctask.doinbackground(linkedinasynctask.java:14) @ android.os.asynctask$2.call(asynctask.java:292) @ java.util.concurrent.futuretask.run(futuretask.java:237) @ android.os.asynctask$serialexecutor$1.run(asynctask.java:231) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:587) @ java.lang.thread.run(thread.java:818) caused by: oauth.signpost.exception.oauthcommunicationexception: communication service provider failed: https://api.linkedin.com/uas/oauth/requesttoken @ oauth.signpost.abstractoauthprovider.retrievetoken(abstractoauthprovider.java:214) @ oauth.signpost.abstractoauthprovider.retrieverequesttoken(abstractoauthprovider.java:69) @ com.google.code.linkedinapi.client.oauth.linkedinoauthserviceimpl.getoauthrequesttoken(linkedinoauthserviceimpl.java:172) @ in.techchefs.talktemple.login.linkedinasynctask.doinbackground(linkedinasynctask.java:45) @ in.techchefs.talktemple.login.linkedinasynctask.doinbackground(linkedinasynctask.java:14) @ android.os.asynctask$2.call(asynctask.java:292) @ java.util.concurrent.futuretask.run(futuretask.java:237) @ android.os.asynctask$serialexecutor$1.run(asynctask.java:231) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:587) @ java.lang.thread.run(thread.java:818) caused by: java.io.filenotfoundexception: https://api.linkedin.com/uas/oauth/requesttoken
here code,
public class linkedinasynctask extends asynctask<string, void, void> { linkedinactivity mcontext; public static linkedinapiclientfactory factory; public static linkedinoauthservice oauthservice; public static linkedinrequesttoken litoken; public static final string linkedin_consumer_key = "xxxxxxx";//gave security purpose only. public static final string linkedin_consumer_secret = "xxxxxxx"; public static final string oauth_callback_scheme = "x-oauthflow-linkedin"; public static final string oauth_callback_host = "callback"; // public static final string oauth_callback_url = oauth_callback_scheme + "://" + oauth_callback_host; public static string oauth_callback_url = "x-oauthflow-linkedin://callback"; public linkedinasynctask(linkedinactivity mcontext) { this.mcontext = mcontext; } @override protected void onpreexecute() { super.onpreexecute(); } @override protected void doinbackground(string... params) { linkedindialog.oauthservice = linkedinoauthservicefactory.getinstance().createlinkedinoauthservice(linkedin_consumer_key, linkedin_consumer_secret); linkedindialog.factory = linkedinapiclientfactory.newinstance(linkedin_consumer_key, linkedin_consumer_secret); linkedindialog.litoken = linkedindialog.oauthservice.getoauthrequesttoken(oauth_callback_url); return null; } @override protected void onpostexecute(void avoid) { super.onpostexecute(avoid); mcontext.setwebview(); } }
please suggest.
i found solution!, problem since running on emulator (which open long time) time data emulator had mismatch linkedin server rejects request minor time differences.hence, solution close , restart emulator.hope, helps someone.
Comments
Post a Comment