Hi DFINITY community!
I’d like to share a project I’ve been working on recently — ic-2fa-auth. It’s a demo desktop app built with Tauri v2, integrating the Internet Computer and Internet Identity. The app allows you to securely store 2FA secrets and generate TOTP codes in a native desktop environment.
A bit of background
Building desktop apps always seemed complex to me. While I respect the tremendous work behind Electron and its huge ecosystem, I was never really excited by the idea of bundling a browser into every app. That changed when I discovered Tauri — it made me want to create a lightweight app that connects to the Internet Computer.
Authentication is a core part of most apps, and that’s where I hit some roadblocks. Initially, all I had was this forum post from @sea-snake (thank you!) outlining some steps, and a strong desire to make it work.
Later, I found a Global R&D video from November 2024 and the article Secure II integration on mobile, which shed more light on mobile/desktop II integration. Thanks to these resources, community posts, and code examples, I was finally able to complete my app for securely storing 2FA secrets and generating TOTP codes using Tauri + IC + II.
Screenshots
Stack and architecture
- Frontend: built with Angular (my favorite framework — I love the direction it’s been heading lately).
- Backend: written in Motoko, running inside a Docker container with Caddy to simulate a production-like environment even during local development (since Tauri’s webview can throw errors when making HTTP requests).
- CI/CD: I set up a GitHub Actions workflow based on tauri-action, with some tweaks for IC integration and auto-generating a
.env
file used by the frontend build. - Special thanks to @ZhenyaUsenko for the Map v9 module, which I used on the backend.
Why I’m posting this
I didn’t want to just drop a GitHub repo without telling the story behind it. I truly hope that sharing my experience, code, and the lessons learned will help other developers, or maybe even inspire someone to explore a new direction with their own IC apps.
If you have any questions, suggestions, or thoughts — feel free to reply here!