[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700770#comment-16700770 ] ASF GitHub Bot commented on CB-14013: - janpio commented on issue #263: CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/263#issuecomment-442148534 Can you please create a new issue @boynet? This will be forgotten here, just link to the PR in your description for context. Thanks for taking the time to report this! This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700749#comment-16700749 ] ASF GitHub Bot commented on CB-14013: - boynet commented on issue #263: CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/263#issuecomment-442143355 I started testing it and I ran into bug, the event only working on the first time so a page with this simple html loaded into inAppBrowser: ``` config: html: click to send event: inAppBrowser.addEventListener('customscheme', function (event) { console.log(event); }); ``` the first click everything is fine, the second click no longer trigger the event This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16529708#comment-16529708 ] wvengen commented on CB-14013: -- This is working really well on Android (thanks!!), are there any plans to implement this on iOS as well? > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16524964#comment-16524964 ] ASF GitHub Bot commented on CB-14013: - wvengen commented on issue #263: CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/263#issuecomment-400647898 Wow, this is **huge** as it (finally) allows 'events' from the inAppBrowser to the Cordova app. Its use goes way beyond OAuth 2. Thanks a lot! As a sidenote: I do see a use-case for allowing `http` and `https` in `AllowedSchemes`: deciding in the Cordova app whether a URL needs to be loaded or not. This would allow for more easily deciding which URLs are opened in the app, and which URLs are opened in the system web browser. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461452#comment-16461452 ] ASF GitHub Bot commented on CB-14013: - timbru31 commented on issue #263: CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/263#issuecomment-386063556 @SailingSteve possible to add support for `staging+mycoolapp`? Currently the plus sign is excluded from your regexp (`^[a-z]*://.*?$`). Numbers would be great, too. Our URL scheme is `d2d`... **edit** PR is #269 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461397#comment-16461397 ] ASF GitHub Bot commented on CB-14013: - timbru31 commented on issue #263: CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/263#issuecomment-386063556 @SailingSteve possible to add support for `staging+mycoolapp`? Currently the plus sign is excluded from your regexp (`^[a-z]*://.*?$`). Numbers would be great, too. Our URL scheme is `d2d`... This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461394#comment-16461394 ] ASF GitHub Bot commented on CB-14013: - timbru31 commented on issue #263: CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/263#issuecomment-386063556 @SailingSteve possible to add support for `staging+mycoolapp`? Currently the plus sign is excluded from your regexp (`^[a-z]*://.*?$`) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16461392#comment-16461392 ] ASF GitHub Bot commented on CB-14013: - timbru31 commented on issue #263: CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/263#issuecomment-386063556 @SailingSteve possible to add support for staging+mycoolapp? Currently the plus sign is excluded from your regexp (`^[a-z]*://.*?$`) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436154#comment-16436154 ] ASF subversion and git services commented on CB-14013: -- Commit 50db5c498c3760a4df9ea4ab569de2832ac19f7f in cordova-plugin-inappbrowser's branch refs/heads/master from [~bowserj] [ https://gitbox.apache.org/repos/asf?p=cordova-plugin-inappbrowser.git;h=50db5c4 ] Merge pull request #263 from SailingSteve/CB-14013-InAppBrowser-AllowCustomSchemes CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436153#comment-16436153 ] ASF GitHub Bot commented on CB-14013: - infil00p closed pull request #263: CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/263 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index 2b0dbe0fa..9b3388ced 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -133,6 +133,7 @@ Licensed to the Apache Software Foundation (ASF) under one private boolean hideUrlBar = false; private boolean showFooter = false; private String footerColor = ""; +private String[] allowedSchemes; /** * Executes the request and returns PluginResult. @@ -1110,6 +,29 @@ else if (url.startsWith("sms:")) { LOG.e(LOG_TAG, "Error sending sms " + url + ":" + e.toString()); } } +// Test for whitelisted custom scheme names like mycoolapp:// or twitteroauthresponse:// (Twitter Oauth Response) +else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^[a-z]*://.*?$")) { +if (allowedSchemes == null) { +String allowed = preferences.getString("AllowedSchemes", ""); +allowedSchemes = allowed.split(","); +} +if (allowedSchemes != null) { +for (String scheme : allowedSchemes) { +if (url.startsWith(scheme)) { +try { +JSONObject obj = new JSONObject(); +obj.put("type", "customscheme"); +obj.put("url", url); +sendUpdate(obj, true); +return true; +} catch (JSONException ex) { +LOG.e(LOG_TAG, "Custom Scheme URI passed in has caused a JSON error."); +} +} +} +} +} + return false; } @@ -1232,4 +1256,4 @@ public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, Str super.onReceivedHttpAuthRequest(view, handler, host, realm); } } -} +} \ No newline at end of file diff --git a/www/inappbrowser.js b/www/inappbrowser.js index 7c3e749e8..3619f173f 100644 --- a/www/inappbrowser.js +++ b/www/inappbrowser.js @@ -36,7 +36,8 @@ 'loadstart': channel.create('loadstart'), 'loadstop': channel.create('loadstop'), 'loaderror': channel.create('loaderror'), -'exit': channel.create('exit') +'exit': channel.create('exit'), +'customscheme': channel.create('customscheme') }; } This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436155#comment-16436155 ] ASF subversion and git services commented on CB-14013: -- Commit 50db5c498c3760a4df9ea4ab569de2832ac19f7f in cordova-plugin-inappbrowser's branch refs/heads/master from [~bowserj] [ https://gitbox.apache.org/repos/asf?p=cordova-plugin-inappbrowser.git;h=50db5c4 ] Merge pull request #263 from SailingSteve/CB-14013-InAppBrowser-AllowCustomSchemes CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16427681#comment-16427681 ] ASF GitHub Bot commented on CB-14013: - SailingSteve commented on issue #263: CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/263#issuecomment-379093903 PR is here https://github.com/apache/cordova-plugin-inappbrowser/pull/263 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14013) cordova-plugin-inappbrowser support for custom URL schemes, as needed for oAuth
[ https://issues.apache.org/jira/browse/CB-14013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16427528#comment-16427528 ] ASF GitHub Bot commented on CB-14013: - SailingSteve opened a new pull request #263: CB-14013: (android) Change the InAppBrowser to allow custom schemes for oAuth URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/263 ### Platforms affected Android ### What does this PR do? Allows oAuth redirects that return to Android with custom schemes like "twitter://code=nnn" to be acted on by the InAppBrowser. This is needed for oAuth 2.0 flow. Here is my actual working JavaScript app code from [https://github.com/WeVote/WebApp/blob/develop/src/js/components/Twitter/TwitterSignIn.jsx](https://github.com/WeVote/WebApp/blob/develop/src/js/components/Twitter/TwitterSignIn.jsx) ``` inAppBrowserRef.addEventListener('customscheme', function (event) { oAuthLog("customscheme: ", event.url); TwitterSignIn.handleTwitterOpenURL(event.url); //inAppBrowserRef.close(); }); ``` You configure the allowable schemes in a comma separated list in a new preference. This implements whitelisting for the allowed schemes, but doesn't use the Cordova Whitelist plugin -- this approach seemed much simpler and safer. See my actual config.xml at [https://github.com/wevote/WeVoteCordova/blob/master/config.xml](https://github.com/wevote/WeVoteCordova/blob/master/config.xml) ``` ``` ### What testing has been done on this change? It has been tested and is working in my app [https://github.com/wevote/WeVoteCordova](https://github.com/wevote/WeVoteCordova). I tested to make sure that single and multiple schemes in the "AllowedSchemes" preference worked as expected. ### Checklist - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB- is the JIRA ID & "android" is the platform affected. - [ ] Added automated test coverage as appropriate for this change. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > cordova-plugin-inappbrowser support for custom URL schemes, as needed for > oAuth > --- > > Key: CB-14013 > URL: https://issues.apache.org/jira/browse/CB-14013 > Project: Apache Cordova > Issue Type: New Feature > Components: cordova-plugin-inappbrowser >Affects Versions: cordova@7.0.0 >Reporter: Steve Podell >Priority: Major > Original Estimate: 72h > Remaining Estimate: 72h > > 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|https://github.com/NGumby]* and comments > about viability from *[infil00p|https://github.com/infil00p]* > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org