Kontyra Docs
Identity Authority•accounts.kontyra.name.ng

Kontyra Auth & Identity Platform

The definitive architectural manual for Kontyra Auth: OpenID Connect (OIDC) discovery, OAuth 2.0 Authorization Code flows with PKCE, WebAuthn biometric Passkeys, and RS256 token verification.

1. Overview & Universal SSO

Kontyra Auth (accounts.kontyra.name.ng) is the central identity provider (IdP) for the Kontyra ecosystem. A single session created here seamlessly authenticates users across DevOS, VUX, VyntaJobs, and Kontyra Console without repeated credential prompts.

Universal Identity Delegation Pipeline

Hardware-backed biometric passkey authentication propagating to all edge applications

Pipeline Flow
User Device & Browser RequestClient Biometrics
accounts.kontyra.name.ng

User triggers sign-in on accounts.kontyra.name.ng via Touch ID, Face ID, or Windows Hello.

Hardware Secure Enclave SignFIDO2 / WebAuthn
Phishing-Resistant

Private key inside device hardware signs random challenge; public signature sent to Kontyra Auth.

RS256 JWT Token MintingIdentity Authority
Rotated JWKS Keys

Issues cryptographically signed JSON Web Token with user claims, organizations, and tier metadata.

Federated Ecosystem IngressUniversal SSO
Bearer Token Auth

Shared session automatically recognized across DevOS IDE, Console, VyntaJobs, and API Gateway.

2. RFC 8414 OIDC Discovery Document

Third-party clients and microservices discover Kontyra's authentication capabilities via the standard OpenID Connect configuration endpoint:

GET https://accounts.kontyra.name.ng/.well-known/openid-configuration
.well-known/openid-configuration
{
  "issuer": "https://accounts.kontyra.name.ng",
  "authorization_endpoint": "https://accounts.kontyra.name.ng/oauth/authorize",
  "token_endpoint": "https://api.kontyra.name.ng/v1/auth/token",
  "userinfo_endpoint": "https://api.kontyra.name.ng/v1/auth/userinfo",
  "jwks_uri": "https://accounts.kontyra.name.ng/.well-known/jwks.json",
  "response_types_supported": ["code"],
  "subject_types_supported": ["public"],
  "id_token_signing_alg_values_supported": ["RS256"],
  "scopes_supported": ["openid", "profile", "email", "kontyra:projects", "kontyra:orgs"],
  "token_endpoint_auth_methods_supported": ["client_secret_post", "client_secret_basic", "none"],
  "code_challenge_methods_supported": ["S256"]
}

3. OAuth 2.0 Authorization Code + PKCE

For browser single-page applications and native CLI tools (such as @kontyra/devos), Auth enforces Proof Key for Code Exchange (PKCE) to prevent code interception attacks:

1. Initiate Authorization
# Redirect user to authorization endpoint with S256 code challenge:
https://accounts.kontyra.name.ng/oauth/authorize?
  response_type=code
  &client_id=knt_client_82910a
  &redirect_uri=https%3A%2F%2Fmyapp.com%2Fcallback
  &scope=openid%20profile%20email
  &code_challenge=E9Melhoa2OwvFrGMTJguCH5rtG6470-WNgMonXOjjZY
  &code_challenge_method=S256
2. Exchange Code for JWT via cURL
curl -X POST https://api.kontyra.name.ng/v1/auth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code" \
  -d "client_id=knt_client_82910a" \
  -d "code=knt_code_4b891a" \
  -d "redirect_uri=https://myapp.com/callback" \
  -d "code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
FIDO2 / WebAuthn• Cross-Device Compatible

4. WebAuthn & FIDO2 Passkeys (Cross-Device Biometrics)

Kontyra replaces vulnerable passwords with WebAuthn credentials. Users authenticate via local device biometrics (Apple Touch ID / Face ID, Windows Hello, or hardware YubiKeys).

Cross-Device Synchronization

Passkeys registered on your laptop automatically sync with your phone via iCloud Keychain or Google Password Manager, or via instant QR scan.

Phishing-Resistant Origin Binding

Passkey signatures are cryptographically bound to accounts.kontyra.name.ng and cannot be intercepted by spoofed domains.

Zero Shared Secrets

Private keys never leave the device's Secure Enclave; the server only validates cryptographic public key signatures.

Registering a Passkey via JavaScript SDK
WebAuthn Client Enrollment
import { startRegistration } from "@simplewebauthn/browser";

// 1. Request registration options from Kontyra Auth API
const optRes = await fetch("https://accounts.kontyra.name.ng/api/auth/passkeys/register-options", {
  method: "POST",
  headers: { Authorization: `Bearer ${userJwtToken}` },
});
const { data } = await optRes.json();

// 2. Invoke native biometric sensor (Touch ID, Windows Hello, Face ID)
const attestation = await startRegistration({ optionsJSON: data.options });

// 3. Complete enrollment on Kontyra Identity Server
await fetch("https://accounts.kontyra.name.ng/api/auth/passkeys/register-verify", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: `Bearer ${userJwtToken}` },
  body: JSON.stringify({
    challengeId: data.challengeId,
    response: attestation,
    deviceName: "MacBook Touch ID"
  }),
});
Enterprise SSO• Okta / Azure AD / Google Workspace

5. Enterprise SAML 2.0 Identity Provider (IdP)

Organizations can delegate authentication to corporate Identity Providers using industry-standard Security Assertion Markup Language (SAML 2.0). Kontyra acts as the Service Provider (SP), processing signed assertions and automatically provisioning corporate users.

Kontyra Service Provider (SP) Configuration Parameters
SP Entity ID / Audience:urn:kontyra:accounts:sp:{orgId}
Assertion Consumer Service (ACS) URL:https://accounts.kontyra.name.ng/api/sso/saml/callback
Download complete XML metadata for IT Administrators: https://accounts.kontyra.name.ng/api/sso/saml/metadata?orgId={orgId}
SP-Initiated SAML Redirect Flow
# Redirect corporate users from your app directly to their company's IdP login screen:
GET https://accounts.kontyra.name.ng/api/sso/saml/login?orgId=org_acme_corp&targetApp=devos&returnUrl=https%3A%2F%2Fdevos.kontyra.name.ng

# Upon successful verification at Okta/Azure AD, user is redirected back to:
POST https://accounts.kontyra.name.ng/api/sso/saml/callback?orgId=org_acme_corp

6. JWT Token Claims & JWKS Verification

Access tokens issued by Kontyra Auth are formatted as RS256-signed JSON Web Tokens:

Decoded JWT Payload
{
  "iss": "https://accounts.kontyra.name.ng",
  "sub": "usr_98a27b1c",
  "aud": "https://api.kontyra.name.ng",
  "exp": 1790938400,
  "iat": 1790852000,
  "email": "alex@kontyra.name.ng",
  "email_verified": true,
  "name": "Alex Rivera",
  "tier": "pro",
  "orgs": [
    { "id": "org_98f12a", "role": "owner" }
  ]
}

7. Token Refresh & Session Revocation

Refresh tokens are single-use rotated. When a user logs out or terminates a session remotely, an immediate webhook event (user.logout) is broadcast, blacklisting all derived session tokens.

8. Mobile Apps Integration (iOS, Android, React Native, Flutter)

Mobile applications integrate with Kontyra Auth using standardized OAuth 2.0 PKCE over system secure browsers (ASWebAuthenticationSession on iOS and Custom Tabs on Android) or custom URL schemes/Universal Links.

Custom URL Schemes

Configure your app with a unique scheme: mycompanyapp://oauth/callback. Register this URL under Allowed Redirect URIs in Kontyra Console.

App Links & Universal Links

Use verified HTTPS links (e.g. https://mobile.mycompany.com/auth/callback) to avoid URL scheme hijacking on mobile OS.

React Native / Expo Example
import * as AuthSession from 'expo-auth-session';
import * as Crypto from 'expo-crypto';

const discovery = {
  authorizationEndpoint: 'https://accounts.kontyra.name.ng/oauth/authorize',
  tokenEndpoint: 'https://accounts.kontyra.name.ng/oauth/token',
};

export async function loginWithKontyraMobile() {
  const redirectUri = AuthSession.makeRedirectUri({ scheme: 'myapp' });
  
  // 1. Generate PKCE code verifier and challenge
  const request = new AuthSession.AuthRequest({
    clientId: 'knt_client_mobile_app_123',
    redirectUri,
    scopes: ['openid', 'profile', 'email'],
    usePKCE: true,
  });

  // 2. Open system secure browser for login
  const result = await request.promptAsync(discovery);

  if (result.type === 'success') {
    const { code } = result.params;
    
    // 3. Exchange code + verifier for tokens
    const response = await AuthSession.exchangeCodeAsync(
      {
        clientId: 'knt_client_mobile_app_123',
        code,
        redirectUri,
        extraParams: { code_verifier: request.codeVerifier || '' },
      },
      discovery
    );

    console.log('Access Token:', response.accessToken);
    console.log('ID Token:', response.idToken);
  }
}

9. Desktop Apps Integration & Headless SSO Without SDK

Desktop apps built with Tauri, Electron, Rust, or Python can authenticate users without relying on any JavaScript SDK using standard Loopback HTTP redirects or direct headless API authentication with username or email.

Pattern A: Loopback Redirect (Tauri, Electron, CLI)

Spin up a temporary local HTTP listener on http://127.0.0.1:port/callback, open the system browser to Kontyra Accounts, receive the authorization code, and exchange it via PKCE.

1. Start Local Server & Launch Browser
# App opens default browser to Kontyra OAuth:
https://accounts.kontyra.name.ng/oauth/authorize?
  response_type=code
  &client_id=knt_client_desktop_app
  &redirect_uri=http%3A%2F%2F127.0.0.1%3A8080%2Fcallback
  &scope=openid%20profile%20email
  &code_challenge=CHALLENGE_HASH
  &code_challenge_method=S256

Pattern B: Headless Login Without SDK (Username or Email)

Authenticate users directly from native dialogs, terminals, or background services without web views. The endpoint supports both usernames (@handle) and email addresses:

Direct Headless Authentication via cURL
# Login with username:
curl -X POST https://accounts.kontyra.name.ng/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "johndoe",
    "password": "SecurePassword123!"
  }'

# Or login with email:
curl -X POST https://accounts.kontyra.name.ng/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "johndoe@example.com",
    "password": "SecurePassword123!"
  }'
Response Payload (JWT + User Profile)
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "uid": "usr_94821a810",
    "email": "johndoe@example.com",
    "fullName": "John Doe",
    "username": "johndoe"
  }
}

10. Identity REST API Reference

POST/api/auth/passkeys/login-options

Generates WebAuthn authentication challenge for biometric passkeys.

POST/api/auth/passkeys/login-verify

Validates client cryptographic biometric signature and mints Kontyra JWT.

GET/api/sso/saml/metadata?orgId={orgId}

Exports official SAML 2.0 Service Provider (SP) XML metadata for Okta/Azure AD.

POST/api/sso/saml/callback

Assertion Consumer Service (ACS) validating signed SAML responses.

GET/v1/auth/.well-known/openid-configuration

Returns OpenID Connect provider configuration metadata.

POST/v1/auth/token

Exchanges authorization code for access and refresh JWTs.

GET/v1/auth/userinfo

OIDC UserInfo endpoint returning verified claims (sub, email, username, tier).

POST/v1/auth/revoke

Immediately invalidates an active session token or refresh token.