Introducing the New Era of Swift App Development with Okta Mobile SDKs
For years, mobile developers have relied on the Okta OIDC SDK to integrate their apps with Okta. However, as technology advances and new features emerge, a refactor is necessary to keep pace. Today, we're thrilled to announce the availability of the Okta Mobile SDK for Swift, designed to revolutionize swift app development!
Recent breakthroughs at Okta, such as support for Device Single Sign On (SSO) and the Okta Identity Engine (OIE), have made it essential to develop a new generation of SDKs that can seamlessly integrate these features. Our goal is to empower developers with a more efficient and flexible way to build apps that provide a seamless user experience.
Why Replace Our Current SDKs?
We didn't take this decision lightly, but several reasons made it the best choice:
- The OIDC libraries are built upon an aging code base, making maintenance challenging.
- The libraries focus on web-based authentication, introducing overhead when native sign-in is used.
- Targeting mobile and desktop applications limits the possibility of extending to other platforms, such as smart watches, TVs, or app extensions.
- The OIDC libraries assume a single set of tokens will be used at a time, preventing developers from supporting multiple users within an app or multiple tokens for different app extensions or security scopes.
These limitations led us to create a fresh start, focusing on convenience and ease of use. Our goal is to unblock advanced use cases that were previously impossible with the Okta OIDC SDK.
Welcome to the New Okta Mobile SDK
When designing the new SDK, we had several goals:
- Improve the developer experience and streamline the onboarding process
- Eliminate technical debt
- Move from a monolithic architecture to a modular one
- Unlock advanced features and scenarios with flexible extension points
- Support new Okta platform features
These goals shaped the architecture of our SDKs, from high-level capabilities down to individual functions. As a Swift engineer, I'll be using examples from the Okta Mobile SDK for Swift, though everything discussed here also applies to the Kotlin version.
A Walk Through the New Developer Experience
Our primary focus is on providing a streamlined developer experience that makes it easy to integrate with Okta's services. We set ourselves a "1-line-to-integrate" goal for all primary scenarios. This means you should be able to sign in or out with a single line of code. Additionally, the code you write shouldn't be throw-away; simple solutions should grow into more complex ones without requiring a completely different approach.
Modularized Architecture
Breaking the SDK into smaller libraries enables developers to choose only the components needed for their applications. This architecture:
- Forces us to establish clean API contracts between dependent classes
- Keeps runtime app sizes leaner by only importing necessary libraries
- Enables additional SDKs (such as Okta IDX) to build upon and integrate with other tools
Each library has its own area of responsibility:
- AuthFoundation: provides common features required for all authentication-related operations, such as token storage and validation.
- OktaOAuth2: implements primary OAuth 2 flows supported by Okta, including authorization code flow and device authorization flow.
Get Started with the Okta Mobile SDK
Join us in revolutionizing swift app development with our next-generation Okta Mobile SDK. With its modularized architecture, streamlined developer experience, and flexible extension points, you'll be able to build apps that provide a seamless user experience. Start building today!