SwiftUI and Browser Sign In - Okta iOS SDK (OIDC)

Product: Okta iOS SDK (Browser Login)
Platform: iOS
Framework: Swift UI

We’re trying to integrate a new iOS project using Swift UI framework and Swift Package Manager to leverage the Okta iOS SDK to connect.

We were able to get the GitHub iOS samples provided for the Okta OIDC libraries at GitHub - okta/samples-ios: samples-ios to connect. However, the examples all use the UIKit framework and Cocoapods.

We were able to get the OIDC library to pull in to Swift Package manager, but we noticed that the OktaOidc object signInWithBrowser() method takes a UIViewController as it’s primary parameter.

SwiftUI doesn’t use UIViewControllers as primary means of navigation, but they can be wrapped.

Bottom line,
Will this work / is it supported if a wrapped UIViewController is created to pass in rather than the SwiftUI View object? Is there a SwiftUI example for the Browser sign in?

If not, we’ll have to go the OktaAuth route and write custom screens, but would prefer allowing the Okta browser client to handle most use cases.

Thanks in advance.

2 Likes

I take it that 20 days and no response means SwiftUI is not compatible and using the OktaAuth SDK libraries to handle Okta state is the only way to go. This is the route we’ve chosen to go.

Would like to know if/when Okta will support the latest declarative platforms for iOS (SwiftUI) and Android (Jetpack Compose). Writing these 2 applications using OktaAuth SDK to support all Okta states opens the apps up to more points of failure.

Thanks!

1 Like