# Is it possible to SSO from a native app (iOS/Android) to an OIDC app?

**URL:** <https://devforum.okta.com/t/is-it-possible-to-sso-from-a-native-app-ios-android-to-an-oidc-app/10617>\
**Category:** Questions\
**Created:** [August 20, 2020, 5:52pm UTC](https://devforum.okta.com/t/is-it-possible-to-sso-from-a-native-app-ios-android-to-an-oidc-app/10617 "2020-08-20T17:52:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdruth](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/bdruth/32/2102_2.png) [@bdruth](https://devforum.okta.com/u/bdruth)\
**Post date:** [August 20, 2020, 5:52pm UTC](https://devforum.okta.com/t/is-it-possible-to-sso-from-a-native-app-ios-android-to-an-oidc-app/10617/1 "2020-08-20T17:52:46Z")

</div>

I have two apps defined in Okta: one is for my sample native app, using the React Native sample app, `custom-sign-in` flow (see [https://github.com/okta/samples-js-react-native](https://github.com/okta/samples-js-react-native)). This is working fine. Second is an OIDC web-app, that uses nginx+vouch proxy to secure some web endpoints (see [https://developer.okta.com/blog/2018/08/28/nginx-auth-request](https://developer.okta.com/blog/2018/08/28/nginx-auth-request)). This is also working fine.

Both apps use the same group / users / etc. This is all just in a basic starter developer account, nothing special - just trying out Okta to research capabilities.

I’ve also followed the directions to enable `usePersistentCookie` (see [https://developer.okta.com/docs/guides/shared-sso-android-ios/ios/session-and-persistent-sso/](https://developer.okta.com/docs/guides/shared-sso-android-ios/ios/session-and-persistent-sso/)) and while I can’t say “this is working” - I didn’t run into any errors in running the various Postman steps. I can retrieve the new policy & new rule and it has the correct property set.

So here’s the million dollar question … how do I got about logging into the native app, and having that SSO when I launch a webview to the web app? Before I set the `usePersistentCookie`, I was just getting redirected to the Okta login page when loading the webview, now I get an error from Vouch that says there are too many redirects … so, _presumably_ (or _maybe_), Okta is recognizing the persistent cookie, but not setting something that Vouch needs to recognize that the login flow has completed?

I feel like I’m super close … any help is appreciated.

---

<div class="post-metadata">

**Author:** ![bdruth](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/bdruth/32/2102_2.png) [@bdruth](https://devforum.okta.com/u/bdruth)\
**Post date:** [August 20, 2020, 9:51pm UTC](https://devforum.okta.com/t/is-it-possible-to-sso-from-a-native-app-ios-android-to-an-oidc-app/10617/2 "2020-08-20T21:51:04Z")

</div>

For future searchers - I was able to get this working. The missing piece was sharing the cookie between the native side and the webview side. I thought this was already happening, but it was not. This ended up being simpler to fix than I expected - since I’m using `react-native-webview`, just setting `sharedCookiesEnabled = true` allows the persistent cookie that’s set during the native auth flow to get passed to the webview and everything proceeds swimmingly from there.

Cheers!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 25, 2024, 6:23pm UTC](https://devforum.okta.com/t/is-it-possible-to-sso-from-a-native-app-ios-android-to-an-oidc-app/10617/3 "2024-01-25T18:23:32Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
