OIDC SDK for iOS
The Signicat OIDC SDK for iOS authenticates end-users in your iOS app with a Signicat OIDC client, using the Authorisation Code Flow.
How it works
To learn about the SDK works in the context of a standard authentication flow, see the sections below.
Authentication flow steps
In a standard authentication flow with the SDK, the following steps are performed:
- Your app sets an
OIDCConfiguration, which includes the issuer, client ID, redirect URI and scopes of your Signicat OIDC client. - Your app calls
login(). The SDK reads the discovery document, then opens the authorisation request in the system authentication browser (ASWebAuthenticationSession). - The end-user authenticates with their chosen eID.
- The Signicat service redirects to your registered HTTPS redirect URI. The authentication browser returns the redirect to the SDK in your app and closes.
- The SDK validates the redirect and exchanges the authorisation code and PKCE verifier for tokens.
- Optional: If you set
persistSessiontotrue, the SDK stores the session encrypted in the Keychain. - The SDK returns an
OIDCSessionto your app, completing the login.
Authentication flow sequence diagram
In a standard authentication flow with the SDK, the following sequence diagram shows a successful login:
Sequence diagram showing a standard authentication flow with the SDK
Key characteristics
The Signicat OIDC SDK for iOS has the following key characteristics:
- Built on AppAuth: The SDK contains its own copy of AppAuth for iOS and uses it for authorisation and the token lifecycle.
- PKCE by default: Authorisation requests use Proof Key for Code Exchange (PKCE). Your app does not need a client secret.
- System authentication browser: The Signicat service's pages never load inside your app. The browser shares persistent cookies with Safari.
- Automatic token refresh:
getSession()andgetUserInfo()refresh an expired access token. - Optional session persistence: By default, the SDK keeps the session in memory only. Set
persistSessiontotrueto store the session encrypted in the Keychain for the configured issuer and client ID. When the app starts again, set the same configuration and callgetSession()to restore the session.
Known limitations
- Swift only: The SDK has a Swift API. To use it from Objective-C or a cross-platform framework such as React Native, write a Swift wrapper.
- Associated domain required: Standard login works only when the host of your redirect URI lists your app under
webcredentials. To learn more, see Associate your app with the redirect domain. - Sign-in prompt: Before the browser opens, iOS asks the end-user to allow your app to sign in with the Signicat domain.
- App-to-app flow needs app code: In the app-to-app flow, your app validates the return link and continues the flow. To learn more, see App-to-app flow.
- One session at a time: Changing the configuration removes the session. To learn more, see Set the configuration.
- Limited authorisation parameters: In addition to the scopes, you can only add
acr_valuesandprompt=loginto the authorisation request. - Manual installation: You add the SDK to your project as an XCFramework. Swift Package Manager and CocoaPods are not supported.
- AppAuth included: If your app also links AppAuth, directly or through a library, the two copies of AppAuth can conflict.
Get started
Use the buttons below to set up the SDK in your project, use its core operations and run the demo app:
Support
If you encounter issues or need guidance on handling errors, use the following resources:
If you need help or want to report an issue, contact us by creating a support ticket in the Signicat Dashboard.