# Do not cURL this URL yourself. Redirect or display it to the user.
import urllib.parse
import secrets
state = secrets.token_urlsafe(32) # store in session for CSRF verification
params = {
"client_id": "your-client-id",
"redirect_uri": "https://your-app.com/callback",
"response_type": "code",
"scope": "offline_access organization.read",
"state": state,
}
auth_url = "https://oauth.qonto.com/oauth2/auth?" + urllib.parse.urlencode(params)
# Do not requests.get(auth_url) yourself. On your backend, respond to the
# user's request with an HTTP 302 redirect to auth_url, e.g. in Flask:
# return redirect(auth_url)
const crypto = require('crypto');
const state = crypto.randomBytes(32).toString('hex'); // store in session
const params = new URLSearchParams({
client_id: 'your-client-id',
redirect_uri: 'https://your-app.com/callback',
response_type: 'code',
scope: 'offline_access organization.read',
state,
});
const authUrl = `https://oauth.qonto.com/oauth2/auth?${params.toString()}`;
// Do not fetch(authUrl) yourself. On your backend, respond to the user's
// request with an HTTP 302 redirect to authUrl, e.g. in Express:
// res.redirect(authUrl)
$state = bin2hex(random_bytes(32)); // store in session for CSRF verification
$params = [
'client_id' => 'your-client-id',
'redirect_uri' => 'https://your-app.com/callback',
'response_type' => 'code',
'scope' => 'offline_access organization.read',
'state' => $state,
];
$authUrl = 'https://oauth.qonto.com/oauth2/auth?' . http_build_query($params);
// Do not call $authUrl yourself. On your backend, respond to the user's
// request with an HTTP 302 redirect to $authUrl, e.g. in Laravel:
// return redirect($authUrl);
state := generateRandomState() // store in session for CSRF verification
params := url.Values{}
params.Set("client_id", "your-client-id")
params.Set("redirect_uri", "https://your-app.com/callback")
params.Set("response_type", "code")
params.Set("scope", "offline_access organization.read")
params.Set("state", state)
authURL := "https://oauth.qonto.com/oauth2/auth?" + params.Encode()
// Do not http.Get(authURL) yourself. On your backend, respond to the
// user's request with an HTTP 302 redirect, e.g.:
// http.Redirect(w, r, authURL, http.StatusFound)
String state = generateRandomState(); // store in session for CSRF verification
String authUrl = "https://oauth.qonto.com/oauth2/auth"
+ "?client_id=" + URLEncoder.encode("your-client-id", StandardCharsets.UTF_8)
+ "&redirect_uri=" + URLEncoder.encode("https://your-app.com/callback", StandardCharsets.UTF_8)
+ "&response_type=code"
+ "&scope=" + URLEncoder.encode("offline_access organization.read", StandardCharsets.UTF_8)
+ "&state=" + state;
// Do not call authUrl yourself. On your backend, respond to the user's
// request with an HTTP 302 redirect, e.g.:
// response.sendRedirect(authUrl);
require 'securerandom'
require 'uri'
state = SecureRandom.hex(32) # store in session for CSRF verification
params = {
client_id: 'your-client-id',
redirect_uri: 'https://your-app.com/callback',
response_type: 'code',
scope: 'offline_access organization.read',
state: state,
}
auth_url = "https://oauth.qonto.com/oauth2/auth?#{URI.encode_www_form(params)}"
# Do not call auth_url yourself. On your backend, respond to the user's
# request with an HTTP 302 redirect, e.g. in Rails:
# redirect_to auth_url
Retrieve an authorization code
Retrieves the authorization of the Qonto user i.e. an authorization code that you will be able to exchange for a set of tokens.
# Do not cURL this URL yourself. Redirect or display it to the user.
import urllib.parse
import secrets
state = secrets.token_urlsafe(32) # store in session for CSRF verification
params = {
"client_id": "your-client-id",
"redirect_uri": "https://your-app.com/callback",
"response_type": "code",
"scope": "offline_access organization.read",
"state": state,
}
auth_url = "https://oauth.qonto.com/oauth2/auth?" + urllib.parse.urlencode(params)
# Do not requests.get(auth_url) yourself. On your backend, respond to the
# user's request with an HTTP 302 redirect to auth_url, e.g. in Flask:
# return redirect(auth_url)
const crypto = require('crypto');
const state = crypto.randomBytes(32).toString('hex'); // store in session
const params = new URLSearchParams({
client_id: 'your-client-id',
redirect_uri: 'https://your-app.com/callback',
response_type: 'code',
scope: 'offline_access organization.read',
state,
});
const authUrl = `https://oauth.qonto.com/oauth2/auth?${params.toString()}`;
// Do not fetch(authUrl) yourself. On your backend, respond to the user's
// request with an HTTP 302 redirect to authUrl, e.g. in Express:
// res.redirect(authUrl)
$state = bin2hex(random_bytes(32)); // store in session for CSRF verification
$params = [
'client_id' => 'your-client-id',
'redirect_uri' => 'https://your-app.com/callback',
'response_type' => 'code',
'scope' => 'offline_access organization.read',
'state' => $state,
];
$authUrl = 'https://oauth.qonto.com/oauth2/auth?' . http_build_query($params);
// Do not call $authUrl yourself. On your backend, respond to the user's
// request with an HTTP 302 redirect to $authUrl, e.g. in Laravel:
// return redirect($authUrl);
state := generateRandomState() // store in session for CSRF verification
params := url.Values{}
params.Set("client_id", "your-client-id")
params.Set("redirect_uri", "https://your-app.com/callback")
params.Set("response_type", "code")
params.Set("scope", "offline_access organization.read")
params.Set("state", state)
authURL := "https://oauth.qonto.com/oauth2/auth?" + params.Encode()
// Do not http.Get(authURL) yourself. On your backend, respond to the
// user's request with an HTTP 302 redirect, e.g.:
// http.Redirect(w, r, authURL, http.StatusFound)
String state = generateRandomState(); // store in session for CSRF verification
String authUrl = "https://oauth.qonto.com/oauth2/auth"
+ "?client_id=" + URLEncoder.encode("your-client-id", StandardCharsets.UTF_8)
+ "&redirect_uri=" + URLEncoder.encode("https://your-app.com/callback", StandardCharsets.UTF_8)
+ "&response_type=code"
+ "&scope=" + URLEncoder.encode("offline_access organization.read", StandardCharsets.UTF_8)
+ "&state=" + state;
// Do not call authUrl yourself. On your backend, respond to the user's
// request with an HTTP 302 redirect, e.g.:
// response.sendRedirect(authUrl);
require 'securerandom'
require 'uri'
state = SecureRandom.hex(32) # store in session for CSRF verification
params = {
client_id: 'your-client-id',
redirect_uri: 'https://your-app.com/callback',
response_type: 'code',
scope: 'offline_access organization.read',
state: state,
}
auth_url = "https://oauth.qonto.com/oauth2/auth?#{URI.encode_www_form(params)}"
# Do not call auth_url yourself. On your backend, respond to the user's
# request with an HTTP 302 redirect, e.g. in Rails:
# redirect_to auth_url
security in the spec. See Available methods.
curl, or any other HTTP client. Your server only builds the URL string, then either redirects the user to it using an HTTP 302 status code or opens a pop-up with that URL. Calling this endpoint yourself and forwarding the resulting redirect location to the user breaks the CSRF cookie binding tied to the browser session, and causes request_forbidden: No CSRF value available in the session cookie.GET /integrations/qonto/authorize). Your backend builds the authorization URL below and responds with an HTTP 302 redirect to it — the user’s browser then follows that redirect to Qonto. The code samples on this page build that URL only — they never call it.Query Parameters
Unique identifier of your application. Please sign up to the Developer Portal to get one.
Example: "475670cc-e41a-4baa-8eb6-4329af7d1450"
URI to which the Qonto user will be redirected back after they have accepted the connection of your application with their account.
☝️ redirect_uri needs to be encoded through this tool.
Example: "https%3A%2F%2Fmy-company-server.com%2F"
It represents the list of permission that your application is requesting on the user account. It can be a single scope or a list of scopes together. In the latter case, the scopes must be written as a space separated list of values.
Examples:
- Single scope : "offline_access"
- Multiple scopes: "offline_access organization.read payment.write"
Use the offline_access scope if you require a refresh token.
Please refer to the API Reference section of this documentation to find which specific scopes are required for the actions you would like to perform. You will find the list of the available scopes here.
It is a security parameter to protect against forgery attacks.
You need to pass a value that is unique to the user authenticating. At the end of the authentication process, you should compare the received state with the one you provided to make sure they are equal.
Example: "this-is-my-unique-value"
Starts the OAuth flow with a pre-selected organization, linked to the registration_id obtained during the onboarding flow. If this parameter is provided, then the user won't be asked to select an organization during the OAuth flow.
Example: "a584b060-8c96-488d-8bbb-74f0d3d2803c"
Response
Redirects the user to Qonto in order to get their authorization.
⚠️ Once the user is redirected to your redirect URI, you need to check the received state parameter against the one you provided on the request. If they do not match, you should stop the process as the request might have been forged by a malicious third party.
If the client_id is unknown, the user is redirected to Qonto's error page (/404?error=invalid_client) rather than to your redirect_uri.
Was this page helpful?