🔐 Connecting GitBD (GitLab) to Airbyte using OAuth2.0

✅ Steps Followed

1. Create an OAuth Application in GitBD


2. Generate Authorization Code

Paste this URL in your browser (replace placeholders accordingly):

https://gitbd.url.com/oauth/authorize?client_id=&redirect_uri=&response_type=code&scope=api

makefile Copyhttps://gitbd.hsenidmobile.com/oauth/authorize?client_id=63a0b85ba60fff3bbc60e95821e418be6d9a1c21da7e4d610d4095e7ab7fea42&redirect_uri= https://www.google.com/6f9ebf20518926b3e4caeb10d694bde2d621a411d71afad947a553c58cd93fa5response_type=code&scope=api Edit

Example:

https://gitbd.url.com/oauth/authorize?client_id=c4505a79...eca13&redirect_uri=http://localhost:8000/workspaces/2718121b-a6e7-4900-8a45-bfe41a8eb8fa/connections&response_type=code&scope=api

kotlin Copy Edit


3. Exchange Code for Access & Refresh Token

Use this curl command in your terminal (replace placeholders):

curl --location 'https://gitbd.url.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=<your_client_id>' \
--data-urlencode 'client_secret=<your_client_secret>' \
--data-urlencode 'code=<authorization_code>' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'redirect_uri=<your_redirect_uri>'
Example:

bash
Copy
Edit
curl --location 'https://gitbd.url.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=c4505a79...eca13' \
--data-urlencode 'client_secret=ad9316d7...7b93' \
--data-urlencode 'code=a804529a...61f2' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'redirect_uri=http://localhost:8000/workspaces/2718121b-a6e7-4900-8a45-bfe41a8eb8fa/connections'
You will receive a refresh_token, access_token, and token_expiry.

4. Configure Airbyte Source
In Airbyte:

Choose GitLab as the source.

Set the Authorization Method to OAuth2.0.

Fill in:

access_token

refresh_token

client_id

client_secret

token_expiry_date (from the API response)

API URL: https://gitbd.url.com/api/v4

Optional: group/project IDs

Click Test the source.

Written by A.M. Rinas