Flutter : Not getting code while Instagram login (Instagram login not working) The 2019 Stack Overflow Developer Survey Results Are In Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceHow to POST API URL with parameters to Instagram APIHow can I get a user's media from Instagram without authenticating as a user?Instagram iOS API Error Domain=WebKitErrorDomain Code=102 “Frame load interrupted”Unable to get code paramteter in redirect uri for instagramRedirect URI not passing variableNo redirect to callback URL when authenticating to InstagramInstagram php laravel access tokenApache Oltu Instragram integration doesn't return access_token… why?Android Instagram login integrationInstagram API call to retrieve authorization code with CURL returns empty

For what reasons would an animal species NOT cross a *horizontal* land bridge?

How to read αἱμύλιος or when to aspirate

What's the point in a preamp?

Simulating Exploding Dice

What force causes entropy to increase?

Are spiders unable to hurt humans, especially very small spiders?

Keeping a retro style to sci-fi spaceships?

Are there continuous functions who are the same in an interval but differ in at least one other point?

Python - Fishing Simulator

How did the audience guess the pentatonic scale in Bobby McFerrin's presentation?

Why doesn't a hydraulic lever violate conservation of energy?

Did the new image of black hole confirm the general theory of relativity?

Single author papers against my advisor's will?

How to support a colleague who finds meetings extremely tiring?

Sub-subscripts in strings cause different spacings than subscripts

Windows 10: How to Lock (not sleep) laptop on lid close?

What information about me do stores get via my credit card?

Separating matrix elements by lines

How to determine omitted units in a publication

Student Loan from years ago pops up and is taking my salary

How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time

Am I ethically obligated to go into work on an off day if the reason is sudden?

Can each chord in a progression create its own key?

Does Parliament hold absolute power in the UK?



Flutter : Not getting code while Instagram login (Instagram login not working)



The 2019 Stack Overflow Developer Survey Results Are In
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceHow to POST API URL with parameters to Instagram APIHow can I get a user's media from Instagram without authenticating as a user?Instagram iOS API Error Domain=WebKitErrorDomain Code=102 “Frame load interrupted”Unable to get code paramteter in redirect uri for instagramRedirect URI not passing variableNo redirect to callback URL when authenticating to InstagramInstagram php laravel access tokenApache Oltu Instragram integration doesn't return access_token… why?Android Instagram login integrationInstagram API call to retrieve authorization code with CURL returns empty



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am using flutter and I want to achieve log in with Instagram in my app.
So I am following this tutorial for Instagram login,



I am getting success to log in but not getting user details, it is opening Redirect URI (https://www.google.com/) and not getting the code and access token.



Please help me if you know anything.




Note: I am using flutter_webview_plugin for load webview in
flutter.




Here is the code which is opening webview for Instagram login ->



My log print("Code ========== Code"); is not going to print anymore



 Future<Token> getToken(String appId, String appSecret) async 

Stream<String> onCode = await _server();
print("_server ========== _server");
String url =
"https://api.instagram.com/oauth/authorize?client_id=$appId&redirect_uri=https://www.google.com/&response_type=code";
final flutterWebviewPlugin = new FlutterWebviewPlugin();
flutterWebviewPlugin.launch(url);
final String code = await onCode.first;
print("Code ========== Code");
print("Code -> "+code);
final http.Response response = await http.post(
"https://api.instagram.com/oauth/access_token",
body: "client_id": appId, "redirect_uri": "https://www.google.com/", "client_secret": appSecret,
"code": code, "grant_type": "authorization_code");

flutterWebviewPlugin.close();


return new Token.fromMap(json.decode(response.body));


Future<Stream<String>> _server() async
final StreamController<String> onCode = new StreamController();
HttpServer server =
await HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 8585);
server.listen((HttpRequest request) async
final String code = request.uri.queryParameters["code"];
request.response
..statusCode = 200
..headers.set("Content-Type", ContentType.HTML.mimeType)
..write("<html><h1>You can now close this window</h1></html>");
await request.response.close();
await server.close(force: true);
onCode.add(code);
await onCode.close();
);
return onCode.stream;










share|improve this question




























    0















    I am using flutter and I want to achieve log in with Instagram in my app.
    So I am following this tutorial for Instagram login,



    I am getting success to log in but not getting user details, it is opening Redirect URI (https://www.google.com/) and not getting the code and access token.



    Please help me if you know anything.




    Note: I am using flutter_webview_plugin for load webview in
    flutter.




    Here is the code which is opening webview for Instagram login ->



    My log print("Code ========== Code"); is not going to print anymore



     Future<Token> getToken(String appId, String appSecret) async 

    Stream<String> onCode = await _server();
    print("_server ========== _server");
    String url =
    "https://api.instagram.com/oauth/authorize?client_id=$appId&redirect_uri=https://www.google.com/&response_type=code";
    final flutterWebviewPlugin = new FlutterWebviewPlugin();
    flutterWebviewPlugin.launch(url);
    final String code = await onCode.first;
    print("Code ========== Code");
    print("Code -> "+code);
    final http.Response response = await http.post(
    "https://api.instagram.com/oauth/access_token",
    body: "client_id": appId, "redirect_uri": "https://www.google.com/", "client_secret": appSecret,
    "code": code, "grant_type": "authorization_code");

    flutterWebviewPlugin.close();


    return new Token.fromMap(json.decode(response.body));


    Future<Stream<String>> _server() async
    final StreamController<String> onCode = new StreamController();
    HttpServer server =
    await HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 8585);
    server.listen((HttpRequest request) async
    final String code = request.uri.queryParameters["code"];
    request.response
    ..statusCode = 200
    ..headers.set("Content-Type", ContentType.HTML.mimeType)
    ..write("<html><h1>You can now close this window</h1></html>");
    await request.response.close();
    await server.close(force: true);
    onCode.add(code);
    await onCode.close();
    );
    return onCode.stream;










    share|improve this question
























      0












      0








      0








      I am using flutter and I want to achieve log in with Instagram in my app.
      So I am following this tutorial for Instagram login,



      I am getting success to log in but not getting user details, it is opening Redirect URI (https://www.google.com/) and not getting the code and access token.



      Please help me if you know anything.




      Note: I am using flutter_webview_plugin for load webview in
      flutter.




      Here is the code which is opening webview for Instagram login ->



      My log print("Code ========== Code"); is not going to print anymore



       Future<Token> getToken(String appId, String appSecret) async 

      Stream<String> onCode = await _server();
      print("_server ========== _server");
      String url =
      "https://api.instagram.com/oauth/authorize?client_id=$appId&redirect_uri=https://www.google.com/&response_type=code";
      final flutterWebviewPlugin = new FlutterWebviewPlugin();
      flutterWebviewPlugin.launch(url);
      final String code = await onCode.first;
      print("Code ========== Code");
      print("Code -> "+code);
      final http.Response response = await http.post(
      "https://api.instagram.com/oauth/access_token",
      body: "client_id": appId, "redirect_uri": "https://www.google.com/", "client_secret": appSecret,
      "code": code, "grant_type": "authorization_code");

      flutterWebviewPlugin.close();


      return new Token.fromMap(json.decode(response.body));


      Future<Stream<String>> _server() async
      final StreamController<String> onCode = new StreamController();
      HttpServer server =
      await HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 8585);
      server.listen((HttpRequest request) async
      final String code = request.uri.queryParameters["code"];
      request.response
      ..statusCode = 200
      ..headers.set("Content-Type", ContentType.HTML.mimeType)
      ..write("<html><h1>You can now close this window</h1></html>");
      await request.response.close();
      await server.close(force: true);
      onCode.add(code);
      await onCode.close();
      );
      return onCode.stream;










      share|improve this question














      I am using flutter and I want to achieve log in with Instagram in my app.
      So I am following this tutorial for Instagram login,



      I am getting success to log in but not getting user details, it is opening Redirect URI (https://www.google.com/) and not getting the code and access token.



      Please help me if you know anything.




      Note: I am using flutter_webview_plugin for load webview in
      flutter.




      Here is the code which is opening webview for Instagram login ->



      My log print("Code ========== Code"); is not going to print anymore



       Future<Token> getToken(String appId, String appSecret) async 

      Stream<String> onCode = await _server();
      print("_server ========== _server");
      String url =
      "https://api.instagram.com/oauth/authorize?client_id=$appId&redirect_uri=https://www.google.com/&response_type=code";
      final flutterWebviewPlugin = new FlutterWebviewPlugin();
      flutterWebviewPlugin.launch(url);
      final String code = await onCode.first;
      print("Code ========== Code");
      print("Code -> "+code);
      final http.Response response = await http.post(
      "https://api.instagram.com/oauth/access_token",
      body: "client_id": appId, "redirect_uri": "https://www.google.com/", "client_secret": appSecret,
      "code": code, "grant_type": "authorization_code");

      flutterWebviewPlugin.close();


      return new Token.fromMap(json.decode(response.body));


      Future<Stream<String>> _server() async
      final StreamController<String> onCode = new StreamController();
      HttpServer server =
      await HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 8585);
      server.listen((HttpRequest request) async
      final String code = request.uri.queryParameters["code"];
      request.response
      ..statusCode = 200
      ..headers.set("Content-Type", ContentType.HTML.mimeType)
      ..write("<html><h1>You can now close this window</h1></html>");
      await request.response.close();
      await server.close(force: true);
      onCode.add(code);
      await onCode.close();
      );
      return onCode.stream;







      flutter instagram instagram-api flutterwebviewplugin






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 12:13









      Mohit SutharMohit Suthar

      2,77431841




      2,77431841






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Finally, I found the answer actually, This blog was right,



          My mistake is changing Redirect URI



          so i have change Redirect URI https://www.google.com/ to http://localhost:8585 and instagram login works.



          Use http://localhost:8585 this Redirect URI for Instagram login





          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063019%2fflutter-not-getting-code-while-instagram-login-instagram-login-not-working%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Finally, I found the answer actually, This blog was right,



            My mistake is changing Redirect URI



            so i have change Redirect URI https://www.google.com/ to http://localhost:8585 and instagram login works.



            Use http://localhost:8585 this Redirect URI for Instagram login





            share|improve this answer



























              0














              Finally, I found the answer actually, This blog was right,



              My mistake is changing Redirect URI



              so i have change Redirect URI https://www.google.com/ to http://localhost:8585 and instagram login works.



              Use http://localhost:8585 this Redirect URI for Instagram login





              share|improve this answer

























                0












                0








                0







                Finally, I found the answer actually, This blog was right,



                My mistake is changing Redirect URI



                so i have change Redirect URI https://www.google.com/ to http://localhost:8585 and instagram login works.



                Use http://localhost:8585 this Redirect URI for Instagram login





                share|improve this answer













                Finally, I found the answer actually, This blog was right,



                My mistake is changing Redirect URI



                so i have change Redirect URI https://www.google.com/ to http://localhost:8585 and instagram login works.



                Use http://localhost:8585 this Redirect URI for Instagram login






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 11 at 5:11









                Mohit SutharMohit Suthar

                2,77431841




                2,77431841





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063019%2fflutter-not-getting-code-while-instagram-login-instagram-login-not-working%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                    Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                    Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved