Skip to content

[source-microsoft-sharepoint] Add grant-type client_credentials For OAuth2 Flow #35588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task
babrar opened this issue Feb 23, 2024 · 2 comments
Closed
1 task

Comments

@babrar
Copy link

babrar commented Feb 23, 2024

Connector Name

source-microsoft-sharepoint

Connector Version

0.1.0

What step the error happened?

Configuring a new connector

Relevant information

Currently, the connector only supports the Refresh Token grant-type for OAuth authentication. However, it lacks support for the commonly used Client Credentials grant-type.

Conveniently, the Office365-REST-Python-Client library that the connector is based on, already provides client_credentials as a grant-type option for OAuth. For example:

from office365.graph_client import GraphClient

# Authenticate using client credentials
client = GraphClient.with_client_secret(tenant_id, client_id, client_secret)

Adding this as a feature to the connector will greatly improve it's usuability.

Relevant contributor: @lazebnyi @tolik0

Relevant log output

No response

Contribute

  • Yes, I want to contribute
@babrar
Copy link
Author

babrar commented Feb 23, 2024

More specifically, refresh_token is a required attribute for the connector in the Airbyte UI. Therefore, the else condition is never triggered.

if refresh_token:
result = self._msal_app.acquire_token_by_refresh_token(refresh_token, scopes=scope)
else:
result = self._msal_app.acquire_token_for_client(scopes=scope)

Not all OAuth flows require refresh tokens, as outlined in the MSAL docs:
image

@marcosmarxm
Copy link
Member

Hello @babrar Microsoft Sharepoint is a vital part of our community, but it's not currently on our roadmap for updates. This means it might take some time before it gets prioritized by the Airbyte Team. However, we encourage community involvement to improve it, and your contributions are welcome! If you're interested, please reach out to me on Slack so we can discuss how you can help. Thanks for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants