v1.31.0
conocimientopostman-collectionpatterns/

http-signature-mtls.md

Referencia que postman-collection carga bajo demanda desde su SKILL.md.

postman-collectionskill
patternscarpeta
5612 Btamaño
2026-09-08último cambio del pack

Purpose: Configure Postman for APIs using HttpSignature (RSA key pairs) or mTLS authentication. Version: 1.0.0 Context: Some organizations use HttpSignature with public/private key pairs for inter-system APIs (e.g., Portal/Erasmus inter-university exchanges).


HttpSignature Authentication

Overview

HttpSignature uses asymmetric cryptography (RSA key pairs) to sign HTTP requests:

  • Client signs the request with its private key
  • Server verifies the signature with the client's public key
  • Keys are registered per UniversityId in a lookup table

Key Table Structure (Pattern)

┌─────────────────────────────────────────────────────────────┐
│ UniversityId │ HttpSignatureClientPublic  │ ClientPrivate   │
│               │ HttpSignatureServerPublic  │ ServerPrivate   │
├───────────────┼────────────────────────────┼─────────────────┤
│ ORG-KEY-01   │ <RSA Public Key XML>       │ <RSA Private>   │
│ PARTNER-02    │ <RSA Public Key XML>       │ <RSA Private>   │
└─────────────────────────────────────────────────────────────┘

Signing flow:

  1. Client takes HTTP method + URL + headers + body
  2. Signs with HttpSignatureClientPrivate using RSA-SHA256
  3. Server verifies with HttpSignatureClientPublic
  4. Response signed with HttpSignatureServerPrivate
  5. Client verifies response with HttpSignatureServerPublic

Postman Limitations

Postman does not natively support RSA signing in pre-request scripts. The crypto module is not available in the Postman sandbox.

Workarounds:

# Pre-sign the request externally, pass signature as env var
SIGNATURE=$(node sign-request.js --key private.pem --method GET --url "/api/endpoint")

newman run collection.json \
    -e environment.json \
    --env-var "httpSignature=$SIGNATURE"
Option 2: External Signing Service
// Pre-request script calls a local signing service
pm.sendRequest({
    url: "http://localhost:3000/sign",
    method: "POST",
    header: { "Content-Type": "application/json" },
    body: {
        mode: "raw",
        raw: JSON.stringify({
            method: pm.request.method,
            url: pm.request.url.toString(),
            body: pm.request.body ? pm.request.body.raw : "",
            algorithm: pm.environment.get("httpSignatureAlgorithm") || "RSA-SHA256"
        })
    }
}, function (err, res) {
    if (!err && res.code === 200) {
        const signature = res.json().signature;
        pm.request.headers.add({
            key: "X-Signature",
            value: signature
        });
        console.log("🔑 HttpSignature added to request");
    }
});
Option 3: Manual Signature (Development/Testing)

For quick manual testing, generate a signature externally and paste it:

# Generate signature with OpenSSL
echo -n "GET /api/nominations" | openssl dgst -sha256 -sign private.pem | base64

Then set in Postman environment:

  • httpSignature: The base64-encoded signature
  • Add header X-Signature: {{httpSignature}} to requests

Environment Variables for HttpSignature

VariableValueType
httpSignaturePrivateKeyPEM-encoded private key (for local signing)secret
httpSignatureAlgorithmRSA-SHA256 (default)default
httpSignatureKeyIdKey identifier (e.g., ORG-KEY-01)default
signingServiceUrlURL of local signing service (Option 2)default

Security Notes

  • Demo keys can be regenerated freely for testing
  • Production keys MUST NOT be used in Postman - use only in deployed services
  • Store private keys in Azure Key Vault in production environments
  • Rotate keys according to university security policy

mTLS (Mutual TLS)

Overview

mTLS requires both client and server to present TLS certificates. This is infrastructure-level authentication, not typically configured at the API collection level.

Note: mTLS is legacy at the organization. New integrations use HttpSignature or Azure AD. Documented here for reference.

Postman Configuration

  1. Open Postman Settings (gear icon)
  2. Go to Certificates tab
  3. Add client certificate:
    • Host: api.partner.edu
    • PFX file: client-cert.pfx
    • Passphrase: {pfx-password}

Environment Variables

VariableValueType
pfxPathPath to .pfx filedefault
pfxPasswordPFX passphrasesecret

Newman with mTLS

newman run collection.json \
    -e environment.json \
    --ssl-client-cert client-cert.pem \
    --ssl-client-key client-key.pem \
    --ssl-client-passphrase "$PFX_PASSWORD"

Decision Guide

ScenarioRecommended Auth
Internal APIsAzure AD (standard)
External partner APIs (Portal)HttpSignature
Legacy partner integrationmTLS
Third-party APIsAPI Key or OAuth2
Development/quick testingBasic Auth or No Auth

Pattern v1.0.0 - HttpSignature and mTLS for Postman

← Volver a la ficha de postman-collection

Ovillo v1.31.0tag v1.31.0 (2026-10-06) · sin decisiones posteriores69 skills · 19 agents · 22 hooks · 3 reglas · 15 tools · 103 decisionesfuente: ovillo/.claude/skills/postman-collection/patterns/http-signature-mtls.mdCopyright 2026 Hugo Valer Rojas · Apache-2.0