FormidableLabs / FormidableLabs/react-native-app-auth
iOS SSO with ASWebAuthenticationSession and SFSafariViewController
- 主要言語
- Java
- スター
- 2.3k
- フォーク
- 473
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
## Issue
We have a native application that we're prototyping which needs to:
Authenticate a User to fetch an Access Token as a public client via OIDC (OAUTH2)
Render Web Content, in-app, from our web site which is protected by the same IdP (Keycloak) as the access token was fetched from above.
We are using this AppAuth library and it is following the best practices of RFC 8252 by using an external user agent so that the native application cannot snoop on the user credentials. Being iOS 13+, it is using ASWebAuthenticationSession. This part is working perfectly for us.
We are having problems when trying to then access our protected site via SFSafariViewController. The cookies set by the IdP from ASWebAuthenticationSession are not visible. This is the case no matter if the cookies are session or persistent cookies. As such, the user must authenticate again.
I'm highly confused about that state of cookie sharing of various types (persistent vs session) with the various versions of iOS and the various methods (ASWebAuthenticationSession, SFSafariViewController + WKWebView). There seems to be no definitive matrix that I've been able to find.
From spending time researching, it feels like with the present cookie restrictions on iOS (for security + privacy [good things!]), I can't accomplish what I want. This feels like such a common thing to want to do, I'm hoping I'm doing something wrong.
A couple of questions thus follow:
Can persistent and/or session cookie sharing across ASWebAuthenticationSession and SFSafariViewController be allowed in the same app?
If not, are there alternative approaches/patterns?
Thanks!
---
## Environment
iOS
コントリビューションガイド
調査の方向性
Issue に記載されている ASWebAuthenticationSession と SFSafariViewController の動作から始め、iOS バージョン間での Cookie の共有と Cookie の種類に焦点を当ててください。役立つ解決策では、セッション Cookie または永続 Cookie を共有できるかどうかを文書化し、サポートされている代替パターンを特定します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- ios
- 領域
- authentication, mobile
- issue の種類
- バグ
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 20/100