cipp-auth-token

n8n community node: get Microsoft 365 access tokens via certificate-based client assertion (SAM app / CIPP)

Package Information

Released: 6 mo ago
Downloads: 9 weekly / 48 monthly
Latest Version: 0.1.2

Documentation

n8n-nodes-cipp-auth-token

An n8n community node that obtains Microsoft 365 OAuth access tokens using certificate-based client assertion (Secure Application Model / CIPP).

Installation

cd ~/.n8n/custom
npm install n8n-nodes-cipp-auth-token

Setup

  1. Create a credential of type CIPP SAM App API with:
    • Client ID — Azure AD Application (client) ID
    • Private Key — RSA private key in PEM format
    • Certificate — X.509 certificate in PEM format
  2. Add the CIPP Auth Token node to a workflow
  3. Set the Tenant ID to the target Azure AD tenant GUID
  4. Execute — the node returns the full OAuth token response

How It Works

The node implements the OAuth 2.0 client credentials flow with a signed JWT client assertion (RFC 7523):

  1. Computes the certificate's SHA-1 thumbprint (x5t) for the JWT kid header
  2. Builds and signs an RS256 JWT with the private key
  3. POSTs the assertion to https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
  4. Returns the access token response for downstream use

Development

npm install
npm test       # run 18 unit tests
npm run build  # compile TypeScript to dist/

License

MIT

Discussion