AppAuth Android https 方案 - 与 Firefox 和其他浏览器一起使用吗?

Ng *_*ong 1 android appauth

我想知道带有 https 方案的 AppAuth 是否适用于 Firefox 和其他浏览器。

我有一个 CAS 5.2 充当 OAuth Idp,但 idp 不是问题,所以我不会在此处发布设置。

我正在尝试制作一个可以与我的 Idp 一起使用的演示 AppAuth 应用程序,我正在使用https://github.com/openid/AppAuth-Android中的演示进行设置。

我正在使用https redirect_uri 架构,因为此 OAuth Idp 不仅适用于移动设备。

问题是,我只能使 OAuth 在Chrome(和自定义选项卡版本)和三星浏览器(和自定义选项卡版本)中工作。

对于我测试过的其他浏览器(Opera、Dophin、Firefox),我只是盯着我的redirect_uri并拒绝返回应用程序[ https://www.example.net/test_oauth/index.php ](注意:我已经提示用户单击重定向链接)

我希望它不仅能与 Chrome 和三星浏览器兼容,如果它能与 Firefox 自定义选项卡等兼容,那就太好了!

设置与AppAuth Demo基本相同,但仅强制客户端密钥(用于测试目的),以及以下配置

auth_config.json:

{
  "client_id": "TestOAuth",
  "redirect_uri": "https://www.example.net/test_oauth/index.php",
  "authorization_scope": "openid email profile",
  "discovery_uri": "",
  "authorization_endpoint_uri": "https://www.example.net/cas/oauth2.0/authorize",
  "token_endpoint_uri": "https://www.example.net/cas/oauth2.0/accessToken",
  "registration_endpoint_uri": "",
  "user_info_endpoint_uri": "https://www.example.net/cas/oauth2.0/profile",
  "https_required": false
}
Run Code Online (Sandbox Code Playgroud)

AndroidManifest.xml

  <activity android:name="net.openid.appauth.RedirectUriReceiverActivity">
        <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="www.example.net"
                android:path="/test_oauth/index.php"
                android:scheme="https" />
        </intent-filter>
    </activity>
Run Code Online (Sandbox Code Playgroud)

谢谢!

iai*_*gin 7

这里是 AppAuth 的首席维护者。据我所知,Firefox 和其他非基于 Chromium 的浏览器不实现应用程序链接,因此不会尝试将匹配的 Web URL 分派给声明它们的应用程序。因此,如果您必须使用 Web 重定向 URL 进行授权流程,那么我建议您设置一个真实的网页来捕获重定向,并将其转换为附加到按钮或链接的基于自定义方案的 URI。