Chrome自定义选项卡Oauth2流程

问题描述:

我正在使用Chrome自定义选项卡以strava登录。 我可以授权应用程序,但Chrome自定义选项卡在重定向时不会重定向回我的应用程序。Chrome自定义选项卡Oauth2流程

<intent-filter> 
    <action android:name="android.intent.action.VIEW" /> 
    <category android:name="android.intent.category.DEFAULT" /> 
    <category android:name="android.intent.category.BROWSABLE" /> 
    <data 
     android:host="sample.example.com" 
     android:pathPrefix="/" 
     android:scheme="http" /> 
</intent-filter> 

当Chrome自定义选项卡转到重定向URI时,如何重定向回应用程序?

目前strava仅支持http [s]方案。
我认为只有fitbit支持自定义方案从chrome自定义选项卡获取应用程序的回调。

根据此:https://code.google.com/p/chromium/issues/detail?id=536037 URI必须具有自定义方案,否则该应用程序的意图将不会启动。

试试像strava这样的URI:// callback或sample:// example。

此外,请确保意图中定义的URI与使用的redirect_uri参数以及注册到应用程序的参数相匹配。

+0

但strava只支持http [s]方案,所以自定义选项卡将处理该意图。像example:URI这样的URI在域框 – Vicky

+0

中不受支持。然后,您需要确保先前选择了该应用来处理该类型的url。请参阅伊恩在链接上的评论。如果您之前选择该应用程序作为默认处理程序,则重定向将起作用。 – Hennessy