# Best practices and tools for integrating Internet Identity with a Native iOS App?

**URL:** <https://forum.dfinity.org/t/best-practices-and-tools-for-integrating-internet-identity-with-a-native-ios-app/75501>\
**Category:** Developers\
**Created:** [September 3, 2026, 12:42pm UTC](https://forum.dfinity.org/t/best-practices-and-tools-for-integrating-internet-identity-with-a-native-ios-app/75501 "2026-09-03T12:42:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AvazbekNadyrbek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/avazbeknadyrbek/32/40114_2.png) [@AvazbekNadyrbek](https://forum.dfinity.org/u/AvazbekNadyrbek)\
**Post date:** [September 3, 2026, 12:42pm UTC](https://forum.dfinity.org/t/best-practices-and-tools-for-integrating-internet-identity-with-a-native-ios-app/75501/1 "2026-09-03T12:42:30Z")

</div>

Hi everyone!

I am currently building a social network / marketplace on ICP (using Rust for the backend canisters) and I am now moving on to building the native iOS client (Swift).

I am struggling to correctly connect my native iOS app with Internet Identity. Since II relies heavily on WebAuthn and domain origins, I am finding it difficult to implement a smooth and secure authentication flow outside of a standard web browser.

Could the community or DFINITY engineers point me in the right direction? Specifically, I would like to know:

1. **What is the current recommended architecture/flow for iOS + II?** (e.g., generating a session key locally → using ASWebAuthenticationSession → getting a delegation → deep linking back to the app).
2. **Are there any actively maintained Swift SDKs (Agent.swift) or boilerplates** that handle the II delegation flow out of the box?
3. **Alternatives:** Would it be better/easier to use NFID or other auth providers for a native mobile experience instead of raw Internet Identity?

Any code snippets, GitHub examples, or documentation links would be greatly appreciated. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![sea-snake](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sea-snake/32/7243_2.png) [@sea-snake](https://forum.dfinity.org/u/sea-snake)\
**Post date:** [September 3, 2026, 1:00pm UTC](https://forum.dfinity.org/t/best-practices-and-tools-for-integrating-internet-identity-with-a-native-ios-app/75501/2 "2026-09-03T13:00:33Z")

</div>

Documentation and/or libraries are currently lacking in this regard for Internet Identity.

Internet Identity supports link based communication since recently which can also be used for mobile applications to authenticate (= receive delegation) towards a local session key: [https://github.com/dfinity/wg-identity-authentication/blob/cd5ef7d2be5337dda8c9988a4dca18bd120de34b/topics/icrc\_167\_browser\_url\_transport.md](https://github.com/dfinity/wg-identity-authentication/blob/cd5ef7d2be5337dda8c9988a4dca18bd120de34b/topics/icrc_167_browser_url_transport.md)

The JSON-RPC method for authentication (= requesting a delegation) over the above protocol can be found here: [https://github.com/dfinity/wg-identity-authentication/blob/main/topics/icrc\_34\_delegation.md](https://github.com/dfinity/wg-identity-authentication/blob/main/topics/icrc_34_delegation.md)

These JSON-RPC requests for Internet Identity are accepted at `https://id.ai/authorize`.

As mentioned in the first link, it’s _highly_ recommended to use [associated domains](https://developer.apple.com/documentation/xcode/supporting-associated-domains) for native applications to ensure Internet Identity recognizes your applications with an identifier _you_ control contrary to a custom scheme that any app could implement.

I’m aware that the above isn’t great documentation or a step by step guide, but hopefully it contains what you need to get things working 😃

---

<div class="post-metadata">

**Author:** ![Henry\_Suso](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/henry_suso/32/16796_2.png) [@Henry\_Suso](https://forum.dfinity.org/u/Henry_Suso)\
**Post date:** [September 3, 2026, 1:04pm UTC](https://forum.dfinity.org/t/best-practices-and-tools-for-integrating-internet-identity-with-a-native-ios-app/75501/3 "2026-09-03T13:04:03Z")

</div>

I wonder if it would be worth it for someone to build a test app and write the docs.

There’s a lot of room for improvement in the user facing flow of authenticating and inside an iOS app it seems illogical to think that it will be like a 2fa where users have to leave app, go to browser, authenticate with passkey, return to app and maintain the session.

---

<div class="post-metadata">

**Author:** ![sea-snake](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sea-snake/32/7243_2.png) [@sea-snake](https://forum.dfinity.org/u/sea-snake)\
**Post date:** [September 3, 2026, 1:17pm UTC](https://forum.dfinity.org/t/best-practices-and-tools-for-integrating-internet-identity-with-a-native-ios-app/75501/4 "2026-09-03T13:17:08Z")

</div>

Going to a browser (view) is the common authentication flow for any authentication protocol except for specific tightly integrated platform cases (Google sign-in on Android and Apple sign-in on iOS).

This doesn’t mean the user has to literally go back and forth to their browser, most platforms (specifically iOS and Android) support a special view that renders the web interaction within the app itself while not giving the app access to the page. The OP already mentioned `ASWebAuthenticationSession` as an example in that regard.

Most authentication is build on the OIDC protocol that goes over the same web browser back and forth navigation concept that II now also supports. We can’t directly support the OIDC protocol itself given the decentralized nature of the Internet Computer that’s incompatible with bearer tokens kept secret by SSL transport, contrary to message signatures that don’t rely on such secrecy at all.

It’s been on our list for a while to look into creating documentation and/or libraries for native apps, but we haven’t been able to prioritize it yet unfortunately.

---

<div class="post-metadata">

**Author:** ![Henry\_Suso](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/henry_suso/32/16796_2.png) [@Henry\_Suso](https://forum.dfinity.org/u/Henry_Suso)\
**Post date:** [September 3, 2026, 2:58pm UTC](https://forum.dfinity.org/t/best-practices-and-tools-for-integrating-internet-identity-with-a-native-ios-app/75501/5 "2026-09-03T14:58:37Z")

</div>

What’s cool is I have a subscription to chat gpt (20 dollar a month plan) and I will ask it to begin this process. I will post my work in this thread.

---

<div class="post-metadata">

**Author:** ![AvazbekNadyrbek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/avazbeknadyrbek/32/40114_2.png) [@AvazbekNadyrbek](https://forum.dfinity.org/u/AvazbekNadyrbek)\
**Post date:** [September 3, 2026, 6:59pm UTC](https://forum.dfinity.org/t/best-practices-and-tools-for-integrating-internet-identity-with-a-native-ios-app/75501/6 "2026-09-03T18:59:21Z")

</div>

> [@sea-snake](#):
>
> Documentation and/or libraries are currently lacking in this regard for Internet Identity.
> 
> Internet Identity supports link based communication since recently which can also be used for mobile applications to authenticate (= receive delegation) towards a local session key: [https://github.com/dfinity/wg-identity-authentication/blob/cd5ef7d2be5337dda8c9988a4dca18bd120de34b/topics/icrc\_167\_browser\_url\_transport.md](https://github.com/dfinity/wg-identity-authentication/blob/cd5ef7d2be5337dda8c9988a4dca18bd120de34b/topics/icrc_167_browser_url_transport.md)
> 
> The JSON-RPC method for authentication (= requesting a delegation) over the above protocol can be found here: [https://github.com/dfinity/wg-identity-authentication/blob/main/topics/icrc\_34\_delegation.md](https://github.com/dfinity/wg-identity-authentication/blob/main/topics/icrc_34_delegation.md)
> 
> These JSON-RPC requests for Internet Identity are accepted at `https://id.ai/authorize`.
> 
> As mentioned in the first link, it’s _highly_ recommended to use [associated domains](https://developer.apple.com/documentation/xcode/supporting-associated-domains) for native applications to ensure Internet Identity recognizes your applications with an identifier _you_ control contrary to a custom scheme that any app could implement.
> 
> I’m aware that the above isn’t great documentation or a step by step guide, but hopefully it contains what you need to get things working 😃

_Thank you so much for the detailed explanation and the links to the ICRC-167 and ICRC-34 standards! It perfectly clarifies the flow. It’s great to see that II now supports link-based communication. I will look into implementing Universal Links (Associated Domains) on iOS for a secure callback. Really appreciate your help!_

---

<div class="post-metadata">

**Author:** ![AvazbekNadyrbek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/avazbeknadyrbek/32/40114_2.png) [@AvazbekNadyrbek](https://forum.dfinity.org/u/AvazbekNadyrbek)\
**Post date:** [September 3, 2026, 7:03pm UTC](https://forum.dfinity.org/t/best-practices-and-tools-for-integrating-internet-identity-with-a-native-ios-app/75501/7 "2026-09-03T19:03:15Z")

</div>

> [@sea-snake](#):
>
> Going to a browser (view) is the common authentication flow for any authentication protocol except for specific tightly integrated platform cases (Google sign-in on Android and Apple sign-in on iOS).
> 
> This doesn’t mean the user has to literally go back and forth to their browser, most platforms (specifically iOS and Android) support a special view that renders the web interaction within the app itself while not giving the app access to the page. The OP already mentioned `ASWebAuthenticationSession` as an example in that regard.
> 
> Most authentication is build on the OIDC protocol that goes over the same web browser back and forth navigation concept that II now also supports. We can’t directly support the OIDC protocol itself given the decentralized nature of the Internet Computer that’s incompatible with bearer tokens kept secret by SSL transport, contrary to message signatures that don’t rely on such secrecy at all.
> 
> It’s been on our list for a while to look into creating documentation and/or libraries for native apps, but we haven’t been able to prioritize it yet unfortunately.

_Makes total sense! The explanation regarding Bearer tokens vs. Message signatures perfectly highlights the architectural difference of ICP. I will proceed with ASWebAuthenticationSession and Universal Links. Thank you for the clarity, it’s exactly what I needed to move forward!"_
