Issue 580069 in chromium: Chrome Custom tab not triggering url scheme intent

1,604 views
Skip to first unread message

chro...@googlecode.com

unread,
Jan 21, 2016, 9:50:37 AM1/21/16
to chromi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: Pri-2 Via-Wizard Type-Bug OS-Android

New issue 580069 by jejef...@gmail.com: Chrome Custom tab not triggering
url scheme intent
https://code.google.com/p/chromium/issues/detail?id=580069

Steps to reproduce the problem:
1. Authenticate through a OpenId Connect code flow with Chrome custom tabs
and redirect the user to the app thanks to a custom url scheme intent
2. Launch the process again while the session is still up
3. The intent isn't triggered anymore (ERR_UNKNOWN_URL_SCHEME)

What is the expected behavior?

What went wrong?
I need to authenticate the users through a oauth2 process using chrome
custom tabs. The user is sent to the authentication form then types is
login/password. Then it is redirected to a url like myapp://something. An
intent is then triggered and the user is sent back to the app.

The process is working well at first launch when the user is logging in
through the authentication form. However, if I try to get another
authentication code, I get an ERR_UNKNOWN_URL_SCHEME error and the app
stays on the custom tabs.

Here are the three cases I tested :

1st case : Chrome custom tab, forcing the user to use the authentication
form

-The user is sent to the authentication form
-A 302 redirect is done to a custom url
-The user is switched to the app

2nd case : Chrome custom tab (using the session cookie)

-The user is sent to the authentication website
-A 302 redirect is done to a custom url
-An ERR_UNKNOWN_URL_SCHEME occurs

3rd case : Chrome browser (using the authentication form or the session
cookie)

-The user is sent to the authentication website
-A 302 redirect is done to a custom url
-The user is switched to the app

The following RFC draft
(https://tools.ietf.org/html/draft-wdenniss-oauth-native-apps-00) documents
how native apps can implement Oauth2 authorization flows. This
implementation can currently be done with Google Chrome but doesn't work
with Chrome Custom Tabs.

Here's a video to explain the issue :
https://www.youtube.com/watch?v=Y-4uLpUv1lA

Did this work before? No

Chrome version: 47.0.2526.83 Channel: stable
OS Version: 5.1.1
Flash Version: Shockwave Flash 20.0 r0

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Jan 21, 2016, 7:28:13 PM1/21/16
to chromi...@chromium.org
Updates:
Cc: pa...@chromium.org li...@chromium.org

Comment #2 on issue 580069 by ian...@chromium.org: Chrome Custom tab not
(No comment was entered for this change.)

chro...@googlecode.com

unread,
Jan 21, 2016, 7:39:32 PM1/21/16
to chromi...@chromium.org

Comment #3 on issue 580069 by yus...@chromium.org: Chrome Custom tab not
Thanks for the bug report. One thing I want to ask to try out is using a
different session when sending the user for a second time. Looking at the
video, I am guessing you are using the same CustomTabsSession or the same
CustomTabsIntent in both the first and the second case. Then I can guess
again that the tab that was created for case 1 was reused in case 2 and
that ends up getting in a code path where an unexpected behavior happens.

So as a quick solution can you retry step two after calling
CustomTabsClient#newSession if you are using sessions or recreating the
CustomTabsIntent if you are not using any service side calls.

chro...@googlecode.com

unread,
Jan 22, 2016, 4:53:51 AM1/22/16
to chromi...@chromium.org

Comment #4 on issue 580069 by jeje...@gmail.com: Chrome Custom tab not
Hi,

Indeed I was using the same CustomTabsSession or the same CustomTabsIntent
in both the first and the second case. I tried to call a new session and to
recreate a new CustomTabsIntent bu the result is still the same.

If I restart the app, I still get the ERR_UNKNOWN_URL_SCHEME if I try to
reauthenticate thanks to the session cookie (step 2 on the vidéo).

chro...@googlecode.com

unread,
Feb 12, 2016, 6:15:12 AM2/12/16
to chromi...@chromium.org

Comment #6 on issue 580069 by andre...@gmail.com: Chrome Custom tab not
I think it happens is due to the second redirect not being a result of a
user action. Eg: on the first one, the user clicks the login button, and
then the user is redirected. On the second one, the server issues an
automatic redirect as the user is already logged in, and chrome doesn't
follow it.

chro...@googlecode.com

unread,
Feb 15, 2016, 3:11:40 AM2/15/16
to chromi...@chromium.org

Comment #8 on issue 580069 by jeje...@gmail.com: Chrome Custom tab not
This bug seems fixed with m48. I'll run a few more tests but it worked with
chrome 48 on Android 6 & 5.5.1

chro...@googlecode.com

unread,
Feb 18, 2016, 10:23:37 AM2/18/16
to chromi...@chromium.org

Comment #9 on issue 580069 by jeje...@gmail.com: Chrome Custom tab not
I tested my app on three devices with chrome 48+ on Android 6, 5.5.1 & 4.4
and everything worked fine.
Reply all
Reply to author
Forward
0 new messages