Choosing an authentication flow
Machine-to-machine
Backend services, automated pipelines, and MCP clients configured with a static token —
VS Code, Cursor, Windsurf, or the Python SDK. Uses the
client_credentials grant.
This is the flow described on the rest of this page.User-to-service
Interactive AI assistants that connect on behalf of a person and ship their own OAuth
client. Uses the
authorization_code grant with PKCE. Setup is automatic — the client
discovers Cotality’s endpoints for you.
Both flows produce a token presented to the same MCP endpoint, and both are subject to the same rate limits.
The attribution difference matters for audit and compliance. In the user-to-service flow,
activity is traceable to a named individual. In machine-to-machine, it is traceable to the
application only — your own system must record which user triggered a given call.
User-to-service (authorization code with PKCE)
Use this when an interactive AI assistant connects on behalf of a person. You do not configure endpoints manually: the client reads Cotality’s protected-resource metadata, redirects the user to sign in with their Cotality account, and manages token exchange and refresh itself.
The authorization server supports the
authorization_code grant with S256 code challenges and registers clients as public — no client secret is issued or accepted.
This flow is live in both UAT and production. Your client application must be registered with
Cotality before it can use it — the authorization server resolves the incoming
client_id
against its list of permitted clients, and an unregistered client_id is rejected with a
400. Contact your Cotality account team to register your client.Machine-to-machine (client credentials)
Use this for backend services, automated pipelines, and any MCP client configured with a static bearer token. Your application exchanges itsclient_id and client_secret for an access token and sends it as a bearer token. The remainder of this page describes this flow.
Getting a token with client credentials
All requests to Cotality MCP require an access token, which you obtain using your providedclient_id and client_secret OAuth2 credentials. There are three steps:
- Use your
client_idandclient_secretas HTTP basic auth credentials to request an access token from the token endpoint - Extract the
access_tokenfrom the response - Include the
access_tokenas a bearer token on all subsequent requests to Cotality MCP
Step 1: Request an access token
Send aPOST request to the token endpoint for your target environment with your credentials as basic auth:
Step 2: Extract the access token
The response contains your access token in theaccess_token field:
Step 3: Use the token
Include theaccess_token value as a bearer token in the Authorization header on your Cotality MCP connection:
Token expiry
Tokens expire after the duration specified inexpires_in (in seconds). When your token expires, Cotality MCP will reject requests with 401 Unauthorized. Request a new token using the same process.
What your token can access
An access token carries the scopes granted to your API product. Those scopes determine which toolstools/list returns and which tools you may call. Contact your account team to request additional scopes.