title: How to Authenticate with facebook and twitter to the firebase in flutter?
body: <p>I'm trying to authenticate with faceboook and twitter , &amp; done with setUp part of <a href="https://developers.facebook.com/" rel="nofollow noreferrer">facebook Developr console</a>  and implemented facebook login method to dart code but why there is occurring an error at
  <code>facebookLogin.logInWithReadPermission</code>.
  but I'm following the dart packages site <a href="https://pub.dev/packages/flutter_facebook_login#-readme-tab-" rel="nofollow noreferrer">facebook_sign_in</a> Plugin</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>
   Future&lt;FirebaseUser&gt; signInWithFacebook()async{
     FacebookLogin facebookLogin = new FacebookLogin();
     final FacebookLoginResult result = await facebookLogin.logInWithReadPermissions(['email']);
   }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/vrjIf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vrjIf.png" alt="enter image description here"></a></p>
  
  <p><strong>Twitter auth method</strong></p>
  
  <pre><code>Future&lt;bool&gt; signInWithTwitterAccount()async{
    setState(() {
       isLoading=true;
     });
      try{
      TwitterLogin twitterLogin = new TwitterLogin(
        consumerKey: consumerApiKey,
        consumerSecret: consumerSecretApiKey
      );
      TwitterLoginResult  _twitterLoginResult = await twitterLogin.authorize();
       TwitterSession _currentUserTwitterSession = _twitterLoginResult.session;
       AuthCredential authCredential = TwitterAuthProvider.getCredential(
          authToken: _currentUserTwitterSession.token,
          authTokenSecret: _currentUserTwitterSession.secret
       );
       AuthResult result = await auth.signInWithCredential(authCredential);
        if(result.user== null)
          return false;
        return true;
      }catch(error){
        Fluttertoast.showToast(msg: "Log in Error at :$error");
        return false;
      }
   }
  </code></pre>
  
  <p>Twitter SignIn Button:</p>
  
  <pre><code>Widget build(BuildContext context){
    return Scaffold(
      body: Center(
       child: FlatButton(
          child: Text(Login with Twitter),
           onPressed: () async{
             bool res= await signInWithGoogleAccount();
               if(!res)
                { setState(() {
                   isLoading=false;
                  });
                  Fluttertoast.showToast(msg: "Login failed");
                }else{  
                setState(() {
                  isLoading=false;
                });
               Fluttertoast.showToast(msg: "Logged in successfully");
                              Navigator.of(context).pushReplacementNamed('/homepage');  
              }
           },
        )
      )
    );
  }
  </code></pre>
  
  <p>Exception ,when clicked twitter sign in button:</p>
  
  <pre><code>E/Twitter ( 7270): Invalid json: &lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;errors&gt;&lt;error code="415"&gt;Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings&lt;/error&gt;&lt;/errors&gt;
  E/Twitter ( 7270): com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
  E/Twitter ( 7270):      at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
  E/Twitter ( 7270):      at com.twitter.sdk.android.core.models.SafeListAdapter$1.read(SafeListAdapter.java:45)
  E/Twitter ( 7270):      at com.twitter.sdk.android.core.models.SafeMapAdapter$1.read(SafeMapAdapter.java:45)
  E/Twitter ( 7270):      at com.google.gson.Gson.fromJson(Gson.java:927)
  E/Twitter ( 7270):      at com.google.gson.Gson.fromJson(Gson.java:892)
  E/Twitter ( 7270):      at com.google.gson.Gson.fromJson(Gson.java:841)
  E/Twitter ( 7270):      at com.google.gson.Gson.fromJson(Gson.java:813)
  E/Twitter ( 7270):      at com.twitter.sdk.android.core.TwitterApiException.parseApiError(TwitterApiException.java:110)
  E/Twitter ( 7270):      at com.twitter.sdk.android.core.TwitterApiException.readApiError(TwitterApiException.java:95)
  E/Twitter ( 7270):      at com.twitter.sdk.android.core.TwitterApiException.&lt;init&gt;(TwitterApiException.java:43)
  E/Twitter ( 7270):      at com.twitter.sdk.android.core.Callback.onResponse(Callback.java:42)
  E/Twitter ( 7270):      at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
  E/Twitter ( 7270):      at android.os.Handler.handleCallback(Handler.java:794)
  E/Twitter ( 7270):      at android.os.Handler.dispatchMessage(Handler.java:99)
  E/Twitter ( 7270):      at android.os.Looper.loop(Looper.java:176)
  E/Twitter ( 7270):      at android.app.ActivityThread.main(ActivityThread.java:6635)
  E/Twitter ( 7270):      at java.lang.reflect.Method.invoke(Native Method)
  E/Twitter ( 7270):      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
  E/Twitter ( 7270):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
  E/Twitter ( 7270): Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
  E/Twitter ( 7270):      at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)
  E/Twitter ( 7270):      at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215)
  E/Twitter ( 7270):      ... 18 more
  E/Twitter ( 7270): Failed to get request token
  E/Twitter ( 7270): com.twitter.sdk.android.core.TwitterApiException: HTTP request failed, Status: 403
  E/Twitter ( 7270):      at com.twitter.sdk.android.core.Callback.onResponse(Callback.java:42)
  E/Twitter ( 7270):      at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
  E/Twitter ( 7270):      at android.os.Handler.handleCallback(Handler.java:794)
  E/Twitter ( 7270):      at android.os.Handler.dispatchMessage(Handler.java:99)
  E/Twitter ( 7270):      at android.os.Looper.loop(Looper.java:176)
  E/Twitter ( 7270):      at android.app.ActivityThread.main(ActivityThread.java:6635)
  E/Twitter ( 7270):      at java.lang.reflect.Method.invoke(Native Method)
  E/Twitter ( 7270):      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
  E/Twitter ( 7270):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
  I/zygote64( 7270): Do partial code cache collection, code=121KB, data=74KB
  I/zygote64( 7270): After code cache collection, code=121KB, data=74KB
  I/zygote64( 7270): Increasing code cache capacity to 512KB
  E/Twitter ( 7270): Authorization completed with an error
  E/Twitter ( 7270): com.twitter.sdk.android.core.TwitterAuthException: Failed to get request token
  E/Twitter ( 7270):      at com.twitter.sdk.android.core.identity.OAuthController$1.failure(OAuthController.java:94)
  E/Twitter ( 7270):      at com.twitter.sdk.android.core.internal.oauth.OAuth1aService$1.failure(OAuth1aService.java:191)
  E/Twitter ( 7270):      at com.twitter.sdk.android.core.Callback.onResponse(Callback.java:42)
  E/Twitter ( 7270):      at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
  E/Twitter ( 7270):      at android.os.Handler.handleCallback(Handler.java:794)
  E/Twitter ( 7270):      at android.os.Handler.dispatchMessage(Handler.java:99)
  E/Twitter ( 7270):      at android.os.Looper.loop(Looper.java:176)
  E/Twitter ( 7270):      at android.app.ActivityThread.main(ActivityThread.java:6635)
  E/Twitter ( 7270):      at java.lang.reflect.Method.invoke(Native Method)
  E/Twitter ( 7270):      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
  E/Twitter ( 7270):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
  I/Toast   ( 7270): Show toast from OpPackageName:com.company_name.project, PackageName:com.company_name.project
  E/SpannableStringBuilder( 7270): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
  E/SpannableStringBuilder( 7270): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
  W/ContentCatcher( 7270): Failed to notify a WebView
  W/ResourceType( 7270): No package identifier when getting name for resource number 0x00000000
  
  </code></pre>