For the complete documentation index, see llms.txt. You can also append .md to any page URL to get its markdown version.
Skip to main content
For the complete documentation index, see llms.txt.

For the complete documentation index, see llms.txt

Demo app

The Signicat OIDC SDK for iOS includes a demo app that demonstrates a complete integration.

You can use it as a reference implementation and to confirm that your environment works before you integrate the SDK into your own app.

Configuration required

The demo app comes with placeholder values. Before you run it, you must configure it with your own OIDC client.

What does it look like?​

The demo app covers every part of an integration. You can use the steps below to understand what the flow looks like from the mobile app:

  1. When the app starts, it restores the stored session. If there is no stored session, it shows the login screen.
  2. On the login screen, the end-user chooses a configuration: Standard OIDC Login or DigiD App2App.
  3. Standard OIDC Login opens the authorisation request in the system authentication browser, where the end-user authenticates.
  4. DigiD App2App runs the app-to-app flow with the DigiD app.
  5. After a successful login, the demo app displays the access, ID and refresh tokens, the access token's expiry, the ID token claims and the user info claims.
  6. Logging out asks the end-user to confirm, then ends the session at the Signicat service and removes it from the device.

The demo app shows a progress indicator while it logs in or out. If the login fails, it shows the technical error details, which you can copy to debug your integration.

It also contains a complete example of a DigiD app-to-app flow.

Want to learn more?

To learn more, see the Demo app example section on the iOS App-to-app flow page.

Get the demo app​

The demo app is available as a project ZIP file from our Nexus repository, alongside the SDK. Because the repository is private, you need login credentials to access it.

Get login credentials

To get login credentials for our Nexus repository, you can request them by creating a support ticket in the Signicat Dashboard.

To access the file:

  1. Navigate to the demo app in our Nexus repository, then enter your Nexus repository login credentials.
  2. Browse for the version you want, then download oidc-sdk-ios-demo-app-<VERSION>.zip.

The ZIP file contains the Xcode project and the SDK. The project already links SignicatOIDC.xcframework with Embed & Sign, so you do not need to download the SDK separately.

Build the demo app from source​

To build the demo app from the project ZIP file:

  1. Extract the ZIP file, then open oidc-sdk-demo.xcodeproj in Xcode.
  2. Configure the demo app with your OIDC client.
  3. Select the oidc-sdk-demo scheme, then run it on an iOS device.

How it works​

The demo app uses SwiftUI. For an overview of the most important source code files, see the table below:

The file OIDCDemoViewModel+Actions.swift is most useful to read first. It shows how the following SDK operations map to the app state:

  • Restoring a session when the app starts.
  • Logging in.
  • Fetching user info.
  • Logging out.

The file DemoOIDCConfigurations.swift contains the OIDCConfiguration values available on the login screen (Standard OIDC Login and DigiD App2App):

Example: DemoOIDCConfigurations.swift
private let demoIssuerUrl = URL(string: "https://example.com/auth/open")!
private let demoRedirectUri = URL(string: "https://example.com/broker/app/redirect/response")!
private let demoClientId = "your-client-id"

// Built from compile-time literals, so a validation failure is a
// programming error and crashing on first use is intended.
extension OIDCConfiguration {
static let standard = try! OIDCConfiguration(
issuer: demoIssuerUrl,
clientId: demoClientId,
redirectUri: demoRedirectUri,
scopes: ["openid", "offline_access", "mobileid", "mobileid-extra"],
promptLogin: true,
persistSession: true
)

// acrValues selects the DigiD IdP; the extra scopes expose the claims
// it supports.
static let digiDApp2App = try! OIDCConfiguration(
issuer: demoIssuerUrl,
clientId: demoClientId,
redirectUri: demoRedirectUri,
scopes: ["openid", "offline_access", "nin", "idp-id"],
acrValues: "idp:digid-app",
promptLogin: true,
persistSession: true
)
}
Session restore

Both configurations set persistSession to true, so the demo app restores the session when it starts.

To keep the session in memory only and always start on the login screen, set persistSession to false in both configurations.

Configure with your OIDC client​

The demo app comes with placeholder values (example.com and your-client-id). Before you run it, configure it with your own OIDC client:

  1. In DemoOIDCConfigurations.swift, replace demoIssuerUrl, demoClientId and demoRedirectUri with the issuer, client ID and redirect URI of your OIDC client.
  2. In DemoOIDCConfigurations.swift, set scopes in each configuration to the scopes of your OIDC client.
  3. In Xcode, select the oidc-sdk-demo target, go to Signing & Capabilities, then select your team and enter your own bundle identifier.
  4. In oidc-sdk-demo.entitlements, replace example.com in the webcredentials: entry with the host of your redirect URI.
  5. Check that the host of your redirect URI lists the demo app's app ID (<TEAM_ID>.<BUNDLE_ID>) under webcredentials in its apple-app-site-association file. To learn more, see Verify your domain.

To also try the DigiD app-to-app example, you need to both:

  • Replace brokerACSURL in DigiDApp2AppFlow.swift.
  • Replace example.com in the applinks: entry with the host of brokerACSURL. That host must list the app ID under applinks.
Want to learn more?

For details, see the iOS implementation of the DigiD app-to-app flow.

App-to-app example (DigiD app2app)​

Some identity providers authenticate the end-user in their own mobile app rather than on a web page. This is known as an app-to-app flow.

The demo app includes examples of these flows so that you can test them and see how they work.

Want to learn more?

To learn more, see the iOS App-to-app flow page.