I have set up both the environment variables SOURCE_CLIENT_SECRET (Note that the Client secret is generated from the OID widget as per the documentation)and DEST_CLIENT_SECRET and running the replicator with the config file using option 5.I am getting error as per below log
AMAC02Z3123LVCJ:oid-replicator j.subhash.parandekar$ poetry run python3 ./oid_replicator/replicate.py
2023-02-17 18:46:48,239 root INFO - Config file - Repeat line 5:
2023-02-17 18:46:48,239 root INFO - Config file - Repeat line 14:
2023-02-17 18:46:48,239 root INFO - Config file - Repeat line 23:
Starting replication of resources
Replicating assets...
Traceback (most recent call last):
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/client/credentials.py", line 364, in _refresh_access_token
token_result = self.__oauth.fetch_token(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/requests_oauthlib/oauth2_session.py", line 366, in fetch_token
self._client.parse_request_body_response(r.text, scope=self.scope)
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 427, in parse_request_body_response
self.token = parse_token_response(body, scope=scope)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in parse_token_response
validate_token_parameters(params)
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 448, in validate_token_parameters
raise_from_error(params.get('error'), params)
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/oauthlib/oauth2/rfc6749/errors.py", line 399, in raise_from_error
raise cls(**kwargs)
oauthlib.oauth2.rfc6749.errors.InvalidClientError: (invalid_client) AADSTS7000216: 'client_assertion', 'client_secret' or 'request' is required for the 'client_credentials' grant type.
Trace ID: b0528310-0b70-4ee0-9715-daca09e35200
Correlation ID: 5987d7dd-eb61-404c-9525-00954829211c
Timestamp: 2023-02-17 13:16:49Z
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/j.subhash.parandekar/oid-replicator/./oid_replicator/replicate.py", line 8, in <module>
main()
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/replicator/__main__.py", line 401, in main
cognite.replicator.assets.replicate(
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/replicator/assets.py", line 298, in replicate
assets_src = client_src.assets.list(limit=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/client/_api/assets.py", line 295, in list
return self._list(
^^^^^^^^^^^
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/client/_api_client.py", line 489, in _list
for resource_list in self._list_generator(
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/client/_api_client.py", line 395, in _list_generator
res = self._post(url_path=url_path or resource_path + "/list", json=body, headers=headers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/client/_api_client.py", line 135, in _post
return self._do_request(
^^^^^^^^^^^^^^^^^
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/client/_api_client.py", line 148, in _do_request
headers = self._configure_headers(accept, additional_headers=self._config.headers.copy())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/client/_api_client.py", line 190, in _configure_headers
auth_header_name, auth_header_value = self._config.credentials.authorization_header()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/client/credentials.py", line 121, in authorization_header
self.__access_token, self.__access_token_expires_at = self._refresh_access_token()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/j.subhash.parandekar/Library/Caches/pypoetry/virtualenvs/oid-replicator-cwaK-6ym-py3.11/lib/python3.11/site-packages/cognite/client/credentials.py", line 372, in _refresh_access_token
raise CogniteAuthError(
cognite.client.exceptions.CogniteAuthError: Error generating access token: invalid_client, 401, AADSTS7000216: 'client_assertion', 'client_secret' or 'request' is required for the 'client_credentials' grant type.
Trace ID: b0528310-0b70-4ee0-9715-daca09e35200
Correlation ID: 5987d7dd-eb61-404c-9525-00954829211c
Timestamp: 2023-02-17 13:16:49Z