Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-14013

cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • cordova@7.0.0
    • None
    • None
    • Hide
      The existing doc says "<allow-navigation href="*" /><!-- The above is equivalent to these three declarations -->" which isn't true. If you use href="*", then all other allow-navigation lines are ignored, so there is no way to specify a custom scheme. I would change it to <!-- The above is equivalent to these three declarations, and excludes all other declarations that may be specified. -->
      Show
      The existing doc says "<allow-navigation href="*" /><!-- The above is equivalent to these three declarations -->" which isn't true. If you use href="*", then all other allow-navigation lines are ignored, so there is no way to specify a custom scheme. I would change it to <!-- The above is equivalent to these three declarations, and excludes all other declarations that may be specified. -->

    Description

      A very common usage of the inappbrowser is to open a URL to the apps server, as part of the oAuth flow.  After a secure token is created, the final step in the oAuth flow is to redirect back to the Cordova app, to proceed as authenticated.  At the WeVote open source project we use this to authenticate with Twitter and Facebook, other projects want to authenticate with Google, Whatsapp, Skype, etc. 

      There is a package for React Native react-native-oauth that does this, and I was able to get oAuth working for iOS with cordova-plugin-safariviewcontroller, but there is nothing that is stable, maintained, and working that is equivalent for Android.

      A pull request will follow that uses whitelisted schemes to allow the oAuth redirect to complete through the InAppBrowser.  It is a fairly simple code change, that leads to a simple end user implementation, that should be widely appreciated (based on years of mostly unfulfilled Stack Overflow chatter.)

       

      This PR builds on  https://github.com/apache/cordova-plugin-inappbrowser/pull/99 and https://github.com/apache/cordova-plugin-inappbrowser/pull/261 and builds on a good suggestion from NGumby and comments about viability from infil00p

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              SailingSteve Steve Podell
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 72h
                  72h
                  Remaining:
                  Remaining Estimate - 72h
                  72h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified