Skip to content
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

✨ Source Microsoft Sharepoint: Make refresh token optional #37372

Merged
merged 7 commits into from
Apr 24, 2024

Conversation

tolik0
Copy link
Contributor

@tolik0 tolik0 commented Apr 17, 2024

What

This update introduces the optionality of the refresh_token parameter in our OAuth flow configurations. This change allows the implementation of OAuth flows without requiring a refresh token, addressing the needs outlined in #35588.

How

The modification enables the connector to recognize and appropriately handle cases where the refresh_token is omitted from the OAuth configuration. This facilitates more versatile authentication strategies by supporting different grant_type selections based on the presence or absence of the refresh_token.

Copy link

vercel bot commented Apr 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2024 10:42am

@octavia-squidington-iii octavia-squidington-iii added the area/connectors Connector related issues label Apr 17, 2024
@@ -21,6 +21,13 @@ class Config:

# Fields for the OAuth authentication, including tenant_id, client_id, client_secret, and refresh_token
auth_type: Literal["Client"] = Field("Client", const=True)
grant_type: str = Field(
title="OAuth Type",
description="Specifies the location(s) to search for files. Valid options are 'ACCESSIBLE_DRIVES' for all SharePoint drives the user can access, 'SHARED_ITEMS' for shared items the user has access to, and 'ALL' to search both.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update description and
add more details to docs about authentication options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@octavia-squidington-iv octavia-squidington-iv requested a review from a team April 17, 2024 12:29
@@ -27,7 +27,7 @@ This page contains the setup guide and reference information for the Microsoft S
5. Enter **Drive Name**. To find your drive name go to settings and at the top of setting menu you can find the name of your drive.
6. Select **Search Scope**. Specifies the location(s) to search for files. Valid options are 'ACCESSIBLE_DRIVES' for all SharePoint drives the user can access, 'SHARED_ITEMS' for shared items the user has access to, and 'ALL' to search both. Default value is 'ALL'.
7. Enter **Folder Path**. Leave empty to search all folders of the drives. This does not apply to shared items.
8. The **OAuth2.0** authorization method is selected by default. Click **Authenticate your Microsoft SharePoint account**. Log in and authorize your Microsoft account.
8. The **OAuth2.0** authorization is selected by default for authentication. You have the option to choose the `grant_type`: `authorization_code`, which uses a refresh token to maintain access without frequent re-authorizations, or `client_credentials`, which does not require a refresh token. After selecting the desired grant type, click **Authenticate your Microsoft SharePoint account**, log in, and authorize your Microsoft account to connect it with Airbyte.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it tested manually?

I think we hide all logic in the UI by one button and all data inputs from DB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I tested it locally.

@octavia-squidington-iv octavia-squidington-iv requested a review from a team April 18, 2024 10:30
@tolik0 tolik0 changed the title ✨ Source Microsoft Sharepoint: Add grant-type client_credentials for OAuth2 flow ✨ Source Microsoft Sharepoint: Make refresh token optional Apr 18, 2024
@tolik0 tolik0 requested a review from lazebnyi April 19, 2024 09:01
Copy link
Collaborator

@artem1205 artem1205 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please add unit tests for these changes

@tolik0 tolik0 merged commit 9aeb5b6 into master Apr 24, 2024
35 of 36 checks passed
@tolik0 tolik0 deleted the tolik0/source-microsoft-sharepoint/update-oauth branch April 24, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/microsoft-sharepoint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants