Candescent API Documentation

website·Indexed 34 days ago

https://docs.candescent.com

Technical documentation for the Candescent API, featuring guides on OIDC integration, authorization code flows, ID token validation, and technical specifications for Marketplace Partners and financial institutions.

Tokens
4.6K
Snippets
13
Records
31
Agent score
56%

What's inside Candescent

  1. Understand Candescent OIDC SSO Integration Model

    Candescent Digital Banking acts as the Identity Provider (IdP), while the partner or FI application acts as the Relying Party (RP). The system uses a Dual-Domain Architecture:

    • Authorization Endpoint: Hosted on the Financial Institution's (FI) branded domain (user-facing).
    • Token Endpoint: Centralized at api.candescent.com (backend-to-backend).
  2. Candescent Digital Banking API Endpoint Overview

    The Candescent Digital Banking API provides RESTful endpoints across several functional domains. Use the following references to locate specific API documentation:
    Authentication (OAuth 2.0): https://docs.candescent.com/api/generated/authentication/
    Accounts (Balances, History): https://docs.candescent.com/api/generated/accounts/
    Business Banking (Onboarding, Profiles): https://docs.candescent.com/api/generated/business-banking/
    Alert Configuration (Templates, Settings): https://docs.candescent.com/api/generated/alert-configuration/
    Alert Delivery (Triggering, Tracking): https://docs.candescent.com/api/generated/alert-delivery/
    Alert Preferences (Thresholds): https://docs.candescent.com/api/generated/alert-preferences/
    Notification Channels (Device Registration): https://docs.candescent.com/api/generated/notification-channels/
    Customer Management (Profiles, MFA, Password Reset): https://docs.candescent.com/api/generated/customer-management/
    Customer Campaigns (Segmentation, Targeting): https://docs.candescent.com/api/generated/customer-campaigns/
    Money Movement (Transfers, Recipients): https://docs.candescent.com/api/generated/money-movement/
    Documents and Preferences (e-Statements, Compliance): https://docs.candescent.com/api/generated/documents-and-preferences/
    MX (Aggregation, PFM): https://docs.candescent.com/api/generated/mx/
  3. Complete OIDC integration testing and certification

    After registration, the Integration PM will provide the necessary environment-specific assets to begin testing.

    Provided Assets:

    • FI-specific authorization endpoint URLs
    • Centralized token endpoint URLs
    • JWKS files for each environment
    • Client credentials (client_id and client_secret)

    Testing Requirements:

    • Perform complete integration testing in each FI environment.
    • Validate token exchanges, session management, and claim extraction according to the specification.
    • Upon successful testing, the integration will be certified for production use and the PM will coordinate go-live activities.
  4. Implement OIDC Callback Handler in Python Flask

    This implementation demonstrates how to redirect users to an FI authorization endpoint, handle the callback, exchange the authorization code for tokens, and validate the ID token using JWKS.
    from flask import Flask, redirect, request, session, url_for
    from jwcrypto import jwk, jwt
    import secrets
    import base64
    import requests
    import json
    
    app = Flask(__name__)
    app.secret_key = secrets.token_hex(32)
    
    # Configuration
    CLIENT_ID = "your_client_id"
    CLIENT_SECRET = "your_client_secret"
    REDIRECT_URI = "https://yourapp.com/callback"
    TOKEN_ENDPOINT = "https://api.stage.candescent.com/oauth2/v1/token"
    ISSUER = "https://www.digitalinsight.com"
    
    # Load JWKS from file provided by your PM
    with open("jwks.json") as f:
        JWKS = jwk.JWKSet.from_json(f.read())
    
    @app.route("/login")
    def login():
        state = secrets.token_urlsafe(32)
        nonce = secrets.token_urlsafe(32)
        session["oauth_state"] = state
        session["oauth_nonce"] = nonce
        
        # FI-specific authorization endpoint
        auth_endpoint = "https://online.acmebank.com/usr-engage-olb/beta/v1/tpv-sso-authorize"
        
        params = {
            "client_id": CLIENT_ID,
            "redirect_uri": REDIRECT_URI,
            "response_type": "code",
            "scope": "openid profile email",
            "state": state,
            "nonce": nonce
        }
        return redirect(f"{auth_endpoint}?{'&'.join(f'{k}={v}' for k, v in params.items())}")
    
    @app.route("/callback")
    def callback():
        if request.args.get("state") != session.get("oauth_state"):
            return "State mismatch", 400
        
        code = request.args.get("code")
        if not code:
            return "Missing authorization code", 400
        
        credentials = base64.b64encode(f"{CLIENT_ID}:{CLIENT_SECRET}".encode()).decode()
        response = requests.post(
            TOKEN_ENDPOINT,
            headers={
                "Authorization": f"Basic {credentials}",
                "Content-Type": "application/x-www-form-urlencoded"
            },
            data={
                "grant_type": "authorization_code",
                "code": code,
                "redirect_uri": REDIRECT_URI
            }
        )
        
        if not response.ok:
            return f"Token exchange failed: {response.text}", 400
        
        tokens = response.json()
        id_token = tokens["id_token"]
        
        try:
            token = jwt.JWT(key=JWKS, jwt=id_token)
            claims = json.loads(token.claims)
            
            if claims["iss"] != ISSUER:
                return "Invalid issuer", 400
            if claims["nonce"] != session.get("oauth_nonce"):
                return "Invalid nonce", 400
            
            session["user"] = {
                "sub": claims["sub"],
                "name": f"{claims.get('given_name', '')} {claims.get('family_name', '')}",
                "email": claims.get("email")
            }
            return redirect(url_for("dashboard"))
        except Exception as e:
            return f"Token validation failed: {e}", 400
    
    @app.route("/dashboard")
    def dashboard():
        if "user" not in session:
            return redirect(url_for("login"))
        return f"Welcome, {session['user']['name']}!"
    
    # Required packages: pip install flask requests jwcrypto
  5. Use the OIDC Toolkit for local development

    The OIDC Toolkit simulates the Candescent OIDC flow locally. It can be run natively with Node.js 20+ or via Docker. You can modify the frontend (default 8000) and backend (default 9000) ports in sample-web-app/config.json. Use the built-in OIDC Validator page for automated E2E tests.
    # Clone from GitHub
    git clone https://github.com/candescent-dev/oidc-sso-toolkit.git
    
    # Or use Docker
    docker pull ghcr.io/candescent-dev/oidc-sso-toolkit:latest
  6. Marketplace Partner OIDC prerequisites

    Marketplace Partners must meet the following technical and infrastructure requirements before integrating with Candescent OIDC:

    • Technical Knowledge: Proficiency in OIDC/OAuth 2.0 and the Authorization Code Flow.
    • Infrastructure: Secure infrastructure for secrets management and the ability to perform server-side HTTP requests and JWT validation.
    • Access: Access to the Developer Console (provided by the PM).
    • Storage: Ability to securely store client credentials and JWKS files.
    • Recommended: Complete local development testing using the OIDC Toolkit before production registration.
  7. Route Authorization Requests for Multi-FI Partner Integrations

    Marketplace Partners serving multiple Financial Institutions must dynamically route users to the correct FI-branded authorization endpoint.

    Methods to identify the originating FI:

    • Query Parameter: e.g., https://partner.com/sso?fi=acme_bank
    • Subdomain: e.g., acmebank.partner.com
    • Path Parameter: e.g., https://partner.com/fi/acme_bank/sso
    • Session Context: Based on a prior user selection (e.g., a dropdown).

    Best Practice: Store the FI identifier in the state parameter during the OAuth flow to maintain context and associate the callback with the correct FI configuration.

  8. Use the OIDC Toolkit for local development

    The OIDC Toolkit allows developers to build, debug, and verify OIDC client implementations locally before moving to QA validation. It simulates the complete authorization code flow, generates test credentials, and provides tools to validate ID tokens and user claims.
  9. Validate OIDC integration and ID tokens

    Integrations can be validated manually or automatically:

    1. Manual Validation: Decode the ID token at jwt.io and verify the signature using the JWK file downloaded from the toolkit.
    2. Automated Validation: Use the OIDC Validator page in the toolkit and click Run Validator. This generates an e2e-report.html (human-readable) or jest-e2e.xml (JUnit XML for CI/CD).
  10. Register OIDC integration for Financial Institutions

    To register an OIDC integration, provide the following information to your assigned Candescent Integration PM:

    1. Business Details: Purpose and use case, primary business and technical contacts, and the expected launch timeline.
    2. Initialization URLs: Exact HTTPS addresses (no wildcards) for QA, Stage, and Production environments that Candescent targets during SSO.
    3. Callback Configuration: A list of authorized callback URLs (redirect URIs) for each environment and the specific domains that need to be whitelisted.

    Configuration Requirements:

    • Redirect URIs must be HTTPS only and cannot contain wildcards.
    • Authentication must be configured using either client_secret_basic or client_secret_post.
    • Security parameters state and nonce must be implemented.
    • Credentials should be stored in a secure secrets management system.
  11. Test OIDC Implementation Locally with the OIDC Toolkit

    The OIDC Toolkit simulates the complete OIDC flow, including endpoints, claims, and token formats used in production. It is ideal for testing token parsing and validation logic.
    # Option 1: Native Setup
    git clone https://github.com/candescent-dev/oidc-sso-toolkit.git
    cd oidc-sso-toolkit
    
    # Start backend (Terminal 1)
    cd sample-web-app/backend
    npm install
    npm run start:dev
    
    # Start frontend (Terminal 2)
    cd sample-web-app/frontend
    npm install
    npm start
    # Access at http://localhost:8000
    
    # Option 2: Docker
    docker pull ghcr.io/candescent-dev/oidc-sso-toolkit:latest
    docker run -p 8000:8000 -p 9000:9000 ghcr.io/candescent-dev/oidc-sso-toolkit:latest