This repository contains multiple examples of how to implement BankID authentication in different programming languages and frameworks. The goal is to provide simple, self-contained authentication flows following BankID's official guidelines and best practices.
Each example includes:
- A basic authentication flow
- A simple JWT token issued after successful authentication
- A separate implementation per language/framework
- Full support for BankID test environment
| Language / Framework | Path / Folder |
|---|---|
| ✅ Next.js | /nextjs |
| 🚧 React & Node.js | (coming soon) |
| 🚧 C++ | (coming soon) |
| 🚧 C# | (coming soon) |
| 🚧 Rust | (coming soon) |
| 🚧 Python | (coming soon) |
| 🚧 Go | (coming soon) |
- Compliant with BankID's technical requirements and flow (Auth → Collect → Completion).
- Designed for learning and quick prototyping.
- Stateless JWT-based session handling.
- Easy to extend into production systems.
All examples in this repository use BankID test certificates. These are only valid for development and testing purposes in BankID’s test environment.
- You must acquire production certificates from BankID via your integration partner or BankID directly.
- Never commit certificates or sensitive data to version control.
- Certificates should be securely loaded via environment variables or secure configuration tools.
- Make sure
.gitignoreincludes all sensitive.pem,.p12, and.crtfiles used locally.
Example .env variables:
BANKID_CLIENT_CERT=path/to/client.pem
BANKID_CLIENT_KEY=path/to/key.pem
BANKID_CA_CERT=path/to/ca.pemFeel free to contribute with examples in more languages (e.g. Python, Go, Rust, C++) or improvements to existing ones. Please ensure your implementation matches the BankID flow and includes certificate management, proper error handling, and basic JWT session handling.
This project is licensed under the MIT License.
