我正在使用此library向我的Android应用添加OAuth
流。
当有人单击SSO page
上的电话或电子邮件链接时,库将引发错误。 The error is ERR_UNKNOWN_URL_SCHEME.
我该如何处理?
下面是我的代码
instantiateOauthManager(getOauthBuilder(authorizationUrl));
OAuthManager.OAuthCallback<Credential> authorizationCallback = future -> {
try {
Credential credential = future.getResult();
this.credential = credential;
} catch (IOException e) {
Log.e(LOG_TAG, "Error getting oauth2 ping sso credential. " + e.getMessage());
} catch (CancellationException e) {
Log.e(LOG_TAG, "Single sign on action has been cancelled by the user. " + e.getMessage());
}
};
oauth.authorizeExplicitly(Constants.PING_SSO_OAUTH2_USERID, authorizationCallback, null);
我的manifest
中有以下内容。
<activity android:name="org.sample.rp.activity.MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="rpconnect" />
</intent-filter>
</activity>
非常感谢!