Summary
The user is facing an ‘invalid_request’ error when trying to connect to OData V4 from Microsoft Business Central 365 using Airbyte connector builder. The error message indicates that the ‘scope’ field is missing from the credential. The user has shared their YAML configuration for reference.
Question
Good afternoon everyone, I would like to introduce myself. My name is Mikel and we are starting with Airbyte. I was trying to connect to OData V4 from Microsoft Business Central 365 of our company to see if I was able to retrieve some data. I have started to create a connector using “Builder”. I enter everything as I have it in Insomnia (where it works correctly for me, also in a Python script using the MSAL library).
I try to connect via OAuth, just like in Insomnia and Python, but I get the error: {
“status”: 400,
“body”: {
“error”: “invalid_request”,
“error_description”: “AADSTS90014: The required field ‘scope’ is missing from the credential. Ensure that you have all the necessary parameters for the login request.”,
“error_codes”: [
90014
],
“timestamp”: “2024-05-15 15:15:18Z”,
“trace_id”: “2b0626bc-b1cd-44c7-9de1-bd469fe77900”,
“correlation_id”: “5967d820-ad17-4b2d-b4a7-d6e2dff8fd75”,
“error_uri”: “https://login.microsoftonline.com/error?code=90014”
…
This is my YAML current configuration, where it only lets me pass the scope as an optional parameter:
version: 0.85.0
type: DeclarativeSource
check:
type: CheckStream
stream_names:
- COMPANIES
definitions:
streams:
COMPANIES:
type: DeclarativeStream
name: COMPANIES
retriever:
type: SimpleRetriever
requester:
$ref: ‘#/definitions/base_requester’
path: Company
http_method: GET
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
schema_loader:
type: InlineSchemaLoader
schema:
$ref: ‘#/schemas/COMPANIES’
base_requester:
type: HttpRequester
url_base: >-
https://api.businesscentral.dynamics.com/(TENANT_ID_HIDED_FOR_SECURITY_REASONS)/Production/ODataV4/
authenticator:
type: OAuthAuthenticator
scopes:
- https://api.businesscentral.dynamics.com/.default
client_id: ‘{{ config[“client_id”] }}’
grant_type: client_credentials
client_secret: ‘{{ config[“client_secret”] }}’
refresh_request_body: {}
token_refresh_endpoint: >-
https://login.microsoftonline.com/(TENANT_ID_HIDED_FOR_SECURITY_REASONS)/oauth2/v2.0/token
streams:
- $ref: ‘#/definitions/streams/COMPANIES’
spec:
type: Spec
connection_specification:
type: object
$schema: http://json-schema.org/draft-07/schema#
required:
- client_id
- client_secret
properties:
client_id:
type: string
order: 0
title: Client ID
airbyte_secret: true
client_secret:
type: string
order: 1
title: Client secret
airbyte_secret: true
additionalProperties: true
metadata:
autoImportSchema:
COMPANIES: true
schemas:
COMPANIES:
type: object
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: true
properties: {}
Would someone be so kind as to help me with this issue? Thank you very much for your precious help. Best regards.
This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. Click here if you want to access the original thread.