Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions markdownpages/profit/en/authentication.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
author: CLN
date: 2026-08-26
date: 2026-09-10
tags: GetConnector, AppConnector, Integration, Configuration, Authentication, Authorization
title: Authentication
---
Expand Down Expand Up @@ -153,10 +153,9 @@ To access the API via the Authorization Code Flow, follow these steps:
1. response_type: code
2. client_id: `<CLIENT_ID>`
3. redirect_uri: `<REDIRECT_URI>`
4. scope: `<SCOPE>`
5. state: `<optional unique value to protect against CSRF>`
6. code_challenge: `<fill in codeChallenge>`
7. code_challenge_method: `<fill in codeChallenge method>`
4. state: `<optional unique value to protect against CSRF>`
5. code_challenge: `<fill in codeChallenge>`
6. code_challenge_method: `<fill in codeChallenge method>`
2. The user logs in and grants permission. After granting permission the user is redirected back to the provided redirect_uri with an authorization code.
2. Exchange the authorization code for an access token
1. Call the [token endpoint](#token-endpoint) (POST) with the following information in the body:
Expand All @@ -171,15 +170,22 @@ To access the API via the Authorization Code Flow, follow these steps:
2. refresh_token: a token that can be used to obtain a new access token.
3. token_type: Bearer
4. expires_in: validity of the access token in seconds.
3. Use the access token
4. Use the access token
1. Copy the access token, prefix it with 'Bearer', and add it to your Authorization header.
5. Obtain a new access token using the refresh token
1. Call the [token endpoint](#token-endpoint) (POST) with the following information in the body:
1. grant_type: refresh_token
2. refresh_token: `<REFRESH_TOKEN>`
3. client_id: `<CLIENT_ID>`
4. client_secret: `<CLIENT_SECRET>`
2. In the response of this call you will find the same fields as in step 3.

#### cURL examples

**Step 1: Redirect user to authorization endpoint:**
```bash
# Open this URL in a browser:
https://<environmentnumber>.rest.afas.online/ProfitRestServices/oauth/authorize?response_type=code&client_id=<CLIENT_ID>&redirect_uri=<REDIRECT_URI>&scope=<SCOPE>&state=<STATE>&code_challenge=<CODE_CHALLENGE>&code_challenge_method=S256
https://<environmentnumber>.rest.afas.online/ProfitRestServices/oauth/authorize?response_type=code&client_id=<CLIENT_ID>&redirect_uri=<REDIRECT_URI>&state=<STATE>&code_challenge=<CODE_CHALLENGE>&code_challenge_method=S256
```

**Step 2: Retrieve token with authorization code:**
Expand Down
20 changes: 13 additions & 7 deletions markdownpages/profit/nl/authentication.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
author: CLN
date: 2026-08-26
date: 2026-09-10
tags: GetConnector, AppConnector, Integration, Configuration, Authentication, Authorization
title: Authenticatie
---
Expand Down Expand Up @@ -152,10 +152,9 @@ Om toegang te krijgen tot de API via de Authorization Code Flow, volg je de volg
1. response_type: code
2. client_id: `<CLIENT_ID>`
3. redirect_uri: `<REDIRECT_URI>`
4. scope: `<SCOPE>`
5. state: `<optionele unieke waarde ter bescherming tegen CSRF>`
6. code_challenge: `<vul codeChallenge in>`
7. code_challenge_method: `<vul codeChallenge methode in>`
4. state: `<optionele unieke waarde ter bescherming tegen CSRF>`
5. code_challenge: `<vul codeChallenge in>`
6. code_challenge_method: `<vul codeChallenge methode in>`
2. De gebruiker logt in en geeft toestemming. Na toestemming wordt de gebruiker teruggeleid naar de opgegeven redirect_uri met een autorisatiecode.
2. Wissel de Autorisatiecode in voor een Access Token
1. Roep het [token endpoint](#token-endpoint) (POST) aan met de volgende informatie in de body:
Expand All @@ -170,15 +169,22 @@ Om toegang te krijgen tot de API via de Authorization Code Flow, volg je de volg
2. refresh_token: een token dat kan worden gebruikt om een nieuw access token te verkrijgen.
3. token_type: Bearer
4. expires_in: geldigheid van het access token in seconden.
3. Access Token Gebruiken
4. Access Token gebruiken
1. Kopieer de access token, zet er 'Bearer' voor, en voeg hem toe in je Authorization header.
5. Een nieuw access token en refresh token ophalen
1. Roep het [token endpoint](#token-endpoint) (POST) aan met de volgende informatie in de body:
1. grant_type: refresh_token
2. refresh_token: `<REFRESH_TOKEN>`
3. client_id: `<CLIENT_ID>`
4. client_secret: `<CLIENT_SECRET>`
2. In de response van deze aanroep vind je dezelfde velden als bij stap 3.

#### cURL voorbeelden

**Stap 1: Gebruiker redirecten naar autorisatie endpoint:**
```bash
# Open deze URL in een browser:
https://<omgevingsnummer>.rest.afas.online/ProfitRestServices/oauth/authorize?response_type=code&client_id=<CLIENT_ID>&redirect_uri=<REDIRECT_URI>&scope=<SCOPE>&state=<STATE>&code_challenge=<CODE_CHALLENGE>&code_challenge_method=S256
https://<omgevingsnummer>.rest.afas.online/ProfitRestServices/oauth/authorize?response_type=code&client_id=<CLIENT_ID>&redirect_uri=<REDIRECT_URI>&state=<STATE>&code_challenge=<CODE_CHALLENGE>&code_challenge_method=S256
```

**Stap 2: Token ophalen met autorisatiecode:**
Expand Down
Loading