Skip to content

Sign in with KRDPASS (App-to-App): Getting Started

This page walks you through everything you need before writing app code: requesting access, installing the SDK, and getting your backend running.

Step 1: Request Access

KRDPASS access is approval-based. Email integration@pass.krd with the details below.

What you submit:

FieldExample
Organization / teamDIT Payments Team
Application nameCitizen Benefits Mobile
Access stagedevelopment, production, or both
Preferred clientId (optional)citizen-benefits-mobile-bff
Scopesopenid profile citizen_identity offline_access
Redirect URIhttps://app-link.example.com/_krdpass/oauth/callback
Android: package name + SHA-256 fingerprintcom.example.myapp + AF:39:67:...:04:BB
iOS: bundle ID + Team IDcom.example.myapp.ios + AB3456789K
Tester emails (for dev access)qa@company.example
Security contactsecurity@company.example

What is "Redirect URI"?

This is your app-launch callback URL (an iOS Universal Link), not your backend API URL. Example: https://app-link.example.com/_krdpass/oauth/callback

Copy-paste email template
text
Subject: KRDPASS onboarding request - [organization] - [application]

Hello KRDPASS Integration Team,

Please onboard our application:

- Organization:
- Application name:
- Access stage: development / production / both
- Preferred clientId (optional):
- Use case summary:
- Scopes:
- Redirect URI(s):
- Android apps (package + SHA-256 + tester emails):
- iOS apps (bundle ID + Team ID + tester emails):
- Security contact:
- Technical contact:

Thanks.

What you'll receive:

  • clientId and clientSecret (shared over secure channel)
  • Approved scopes and access stage
  • Credential policy instructions

WARNING

clientSecret must stay on your backend. Never ship it in a mobile app.

Step 2: Generate Your RSA Key Pair

Your backend signs requests with a private key. The public key is shared during onboarding.

bash
# Generate private key (stays on your server)
openssl genpkey -algorithm RSA -out private-key.pem -pkeyopt rsa_keygen_bits:2048

# Extract public key (submit during onboarding)
openssl rsa -pubout -in private-key.pem -out public-key.pem

Step 3: Clone & Install the SDK

Clone the repository

bash
git clone https://github.com/ditkrg/krdpass-auth-sdk.git

Recommended folder layout:

text
your-app/
krdpass-auth-sdk/

Install your platform SDK

yaml
dependencies:
  krdpass_auth_flutter:
    path: ../krdpass-auth-sdk/packages/krdpass_auth_flutter
yaml
dependencies:
  krdpass_auth_flutter:
    git:
      url: https://github.com/ditkrg/krdpass-auth-sdk.git
      path: packages/krdpass_auth_flutter
      ref: main
kotlin
includeBuild("../krdpass-auth-sdk/packages/krdpass_auth_android") {
    dependencySubstitution {
        substitute(module("krd.pass:krdpass-auth")).using(project(":library"))
    }
}
text
Xcode -> File -> Add Package Dependencies... -> Add Local...
Select: ../krdpass-auth-sdk/packages/krdpass_auth_ios
ruby
pod 'KrdpassAuth', :path => '../krdpass-auth-sdk/packages/krdpass_auth_ios'
bash
npm install ../krdpass-auth-sdk/packages/krdpass_auth_react_native
Android: also add to app/build.gradle.kts
kotlin
dependencies {
    implementation("krd.pass:krdpass-auth:1.0.0")
}
React Native: build fallback

If npm install scripts are disabled:

bash
cd ../krdpass-auth-sdk/packages/krdpass_auth_react_native
npm run build

Step 4: Set Up Your Backend

The SDK repo includes a Node.js reference server at examples/server.

Quick setup

bash
cd examples/server
cp .env.example .env

Fill in your .env:

VariableExampleNotes
CLIENT_IDyour-client-idFrom onboarding
CLIENT_SECRETyour-secretFrom onboarding, server-side only
RSA_PRIVATE_KEY-----BEGIN PRIVATE KEY-----\n...Escaped PEM format
HOST127.0.0.1Local default
PORT3000Local default
ALLOWED_REDIRECT_HOSTSapp-link.example.comRecommended
Convert PEM key to .env format
bash
awk 'NF {sub(/\r/,""); printf "%s\\n",$0;}' private-key.pem

Then paste into .env:

ini
RSA_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"

Start and verify

bash
npm install
npm start
curl http://localhost:3000/health

You should get a healthy response. Your backend is ready.

Step 5: Readiness Checklist

Before moving to the SDK guide, confirm:

Next Step

SDK Integration Guide — Write the auth flow in your app