OAuth2 client credentials is the standard way one server talks to another. Your app exchanges its client_id + client_secret for a short-lived access token (a JWT), then calls the API with that token. No user is involved.
The flow by hand
# 1. Get a token
curl -X POST https://api.ifsjaipur.cloud/oauth/token \
-u "APP_ID:APP_SECRET" \
-d "grant_type=client_credentials&scope=stocks:read"
# -> { "access_token": "...", "token_type": "Bearer", "expires_in": 3600, "scope": "stocks:read" }
# 2. Use it
curl "https://api.ifsjaipur.cloud/playground/data/stocks/candles?shape=flat&page_size=5" \
-H "Authorization: Bearer ACCESS_TOKEN"Setting it up in n8n (step by step)
- Create a new credential of type "OAuth2 API".
- Grant Type: Client Credentials.
- Access Token URL: https://api.ifsjaipur.cloud/oauth/token
- Client ID: your App ID. Client Secret: your App Secret.
- Scope: stocks:read (or fpa:read).
- Authentication: try "Body" first; if the token request fails, switch to "Header (Basic Auth)". Both are accepted.
- Save. Then on the HTTP Request node set Authentication = Generic Credential Type → OAuth2 API, and point the URL at a data endpoint.
| Setting | Value |
|---|---|
| Grant Type | Client Credentials |
| Access Token URL | https://api.ifsjaipur.cloud/oauth/token |
| Client ID | your App ID |
| Client Secret | your App Secret |
| Scope | stocks:read |
- Scope must be one your app was granted — read scopes (fpa:read, stocks:read) are granted automatically. Leave scope blank to get all granted scopes.
- The access token is a JWT that expires in 1 hour; n8n refreshes it automatically.
- invalid_client → wrong Client ID/Secret. invalid_scope → you asked for a scope you were not granted.
Tip · This ties everything together: the token you get here is a JWT (the JWT lesson) and you present it as a Bearer token (the Bearer lesson).