android - Facebook, Twitter & Google integration using socialauth -
android - Facebook, Twitter & Google integration using socialauth -
i building android app connects facebook, twitter , google user logins. getting next error -
org.brickred.socialauth.exception.socialauthexception: unable retrieve access token. status: 400. not connect using socialauth
the code follows -
package com.opaxlabs.boatbrat; import org.brickred.socialauth.profile; import org.brickred.socialauth.android.dialoglistener; import org.brickred.socialauth.android.socialauthadapter; import org.brickred.socialauth.android.socialautherror; import org.brickred.socialauth.android.socialauthlistener; import org.brickred.socialauth.android.socialauthadapter.provider; import android.app.activity; import android.content.intent; import android.os.bundle; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.imageview; import com.facebook.session; import com.facebook.sessionstate; public class loginactivity extends activity { socialauthadapter adapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_login); adapter=new socialauthadapter(new dialoglistener() { @override public void onerror(socialautherror arg0) { log.e("login activity", arg0.getmessage()); } @override public void oncomplete(bundle arg0) { adapter.getuserprofileasync(new socialauthlistener<profile>() { @override public void onexecute(string arg0, profile arg1) { log.d("custom-ui", "receiving data"); profile profilemap = arg1; log.d("custom-ui", "validate id = " + profilemap.getvalidatedid()); log.d("custom-ui", "first name = " + profilemap.getfirstname()); log.d("custom-ui", "last name = " + profilemap.getlastname()); log.d("custom-ui", "email = " + profilemap.getemail()); log.d("custom-ui", "gender = " + profilemap.getgender()); log.d("custom-ui", "country = " + profilemap.getcountry()); log.d("custom-ui", "language = " + profilemap.getlanguage()); log.d("custom-ui", "location = " + profilemap.getlocation()); log.d("custom-ui", "profile image url = " + profilemap.getprofileimageurl()); } @override public void onerror(socialautherror arg0) { // todo auto-generated method stub } }); } @override public void oncancel() { // todo auto-generated method stub } @override public void onback() { // todo auto-generated method stub } }); // adapter.addprovider(provider.facebook, r.drawable.facebook); // adapter.addprovider(provider.google, r.drawable.google); // adapter.addprovider(provider.twitter, r.drawable.twitter); button skip=(button) findviewbyid(r.id.btnskip); skip.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { intent mainintent=new intent(loginactivity.this, mainactivity.class); startactivity(mainintent); } }); imageview imgfacebook=(imageview) findviewbyid(r.id.imageview3); imgfacebook.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { adapter.authorize(loginactivity.this, provider.facebook); } }); imageview imggoogle=(imageview) findviewbyid(r.id.imageview4); imggoogle.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { adapter.addcallback(provider.google,"http://socialauth.in/socialauthdemo"); adapter.authorize(loginactivity.this, provider.google); } }); imageview imgtwitter=(imageview) findviewbyid(r.id.imageview5); imgtwitter.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { adapter.addcallback(provider.twitter,"http://socialauth.in/socialauthdemo/socialauthsuccessaction.do"); adapter.authorize(loginactivity.this, provider.twitter); } }); } }
i have tried commenting , uncommenting adapter.addprovider() lines problem persists. facebook , twitter work fine there problem google. have added client-id , api key generated in credentials oauth_consumer.properties. help appreciated. in advance.
you have provide right callback url.
android facebook twitter socialauth
Comments
Post a Comment