OAuth2 CallBack_Url开发目的

时间:2018-03-09 09:58:46

标签: android android-manifest callbackurl

我正在使用FitBit API开发Android应用程序。这使用Scribe库使用OAuth2身份验证。目前处于开发模式。我有回调问题。

我为开发目的设置了一个callback_uri,“http://locallhost.com/”。这适用于Web浏览器,但不适用于Emulator / Phone。所以我的配置应该有问题..

发送的请求是正确的,因此我的MainActivity中的参数是正确的。在FitBit Developers页面上的Application Settings中,我已正确设置所有参数,因为回调在Web浏览器中有效。

我直接在MainActivity的onCreate()方法中调用..

我做的最后一件事包括我的Android清单文件中的互联网权限和意图过滤器..

意图过滤器如下:

<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="http://locallhost.com/"
                    android:scheme="oauth"/>
</intent-filter>

我的意图过滤器是否正确?

我忘记了什么吗?

- Internet Permission

- Application Settings EndPoint

- Configure the Activity

- Configure Intent Filter in the Manifest

1 个答案:

答案 0 :(得分:0)

尝试这样:

// for the callback "http://locallhost.com"
<data android:host="locallhost.com/"
      android:scheme="http"/>

// for the callback "oauth://locallhost.com"
<data android:host="locallhost.com/"
      android:scheme="oauth"/>
相关问题