# Avoid sign-in screen with iOS native app after initial sign-in

**URL:** <https://devforum.okta.com/t/avoid-sign-in-screen-with-ios-native-app-after-initial-sign-in/11613>\
**Category:** Questions\
**Created:** [November 4, 2020, 2:53pm UTC](https://devforum.okta.com/t/avoid-sign-in-screen-with-ios-native-app-after-initial-sign-in/11613 "2020-11-04T14:53:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SandyP](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@SandyP](https://devforum.okta.com/u/SandyP)\
**Post date:** [November 4, 2020, 2:53pm UTC](https://devforum.okta.com/t/avoid-sign-in-screen-with-ios-native-app-after-initial-sign-in/11613/1 "2020-11-04T14:53:53Z")

</div>

When using a native mobile app, how can we get the Okta sign-window to know that the user has already logged in, to not show the login screen and simply redirect back to the app?

- Is this something the app must handle by validating the token before calling the okta sign-in?

Context:

- iOS native app
- not using okta SDK, but making direct API calls
- using ASWebAuthenticationSession, with prefersEphemeralWebBrowserSession = false

What is working:

- PKCE flow
- Okta sign-in window
- Fetch access token and refresh token
- Calling Node.js server and validating JWT

So this is all good.

However, if the app then directs the user _again_ to the Okta sign-window, the user must again login.

Thanks,

---

<div class="post-metadata">

**Author:** ![sigama](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/sigama/32/5811_2.png) [@sigama](https://devforum.okta.com/u/sigama)\
**Post date:** [November 13, 2020, 12:10am UTC](https://devforum.okta.com/t/avoid-sign-in-screen-with-ios-native-app-after-initial-sign-in/11613/2 "2020-11-13T00:10:17Z")

</div>

Hi @SandyP! Unfortunately, ASWebAuthenticationSession doesn’t share cookies with Web Views - this is an iOS limitation. Please see:

- [https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession](https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession)
- [https://github.com/openid/AppAuth-iOS/issues/432#issuecomment-523904316](https://github.com/openid/AppAuth-iOS/issues/432#issuecomment-523904316)

---

<div class="post-metadata">

**Author:** ![SandyP](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@SandyP](https://devforum.okta.com/u/SandyP)\
**Post date:** [November 17, 2020, 5:27pm UTC](https://devforum.okta.com/t/avoid-sign-in-screen-with-ios-native-app-after-initial-sign-in/11613/3 "2020-11-17T17:27:32Z")

</div>

Thanks Semona.

Is there a best practice/recommended flow when using iOS for an Okta login?

For example, should the IOS app do a token validation _before_ starting the sign-in flow? Would this be something reasonable?

Or is there another work-around that you can recommend?

---

<div class="post-metadata">

**Author:** ![sigama](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/sigama/32/5811_2.png) [@sigama](https://devforum.okta.com/u/sigama)\
**Post date:** [November 19, 2020, 1:14am UTC](https://devforum.okta.com/t/avoid-sign-in-screen-with-ios-native-app-after-initial-sign-in/11613/4 "2020-11-19T01:14:56Z")

</div>

@SandyP you may want to look into our Auth Swift SDK as there has been a workaround there [https://github.com/okta/okta-auth-swift/issues/98](https://github.com/okta/okta-auth-swift/issues/98).

---

<div class="post-metadata">

**Author:** ![SandyP](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@SandyP](https://devforum.okta.com/u/SandyP)\
**Post date:** [November 19, 2020, 2:41pm UTC](https://devforum.okta.com/t/avoid-sign-in-screen-with-ios-native-app-after-initial-sign-in/11613/5 "2020-11-19T14:41:50Z")

</div>

Hi, I don’t see how that example uses **ASWebAuthenticationSession()** from iOS 14.

I am trying avoid the Okta sign-in page when the user has already Okta logged in from the same app

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 25, 2024, 11:31pm UTC](https://devforum.okta.com/t/avoid-sign-in-screen-with-ios-native-app-after-initial-sign-in/11613/6 "2024-01-25T23:31:09Z")

</div>

Closed on January 25, 2024, 11:31pm UTC


