Skip to content

Commit

Permalink
changing scope for google drive api
Browse files Browse the repository at this point in the history
  • Loading branch information
Taylor Grafft committed Nov 6, 2023
1 parent b51c41f commit e0a4efb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/portal/apps/googledrive_integration/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def initialize_token(request):
reverse('googledrive_integration:oauth2_callback'))
flow = google_auth_oauthlib.flow.Flow.from_client_config(
get_client_config(),
scopes=['https://www.googleapis.com/auth/drive'])
scopes=['https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive.appdata'])
flow.redirect_uri = request.build_absolute_uri(redirect_uri)
# flow.redirect_uri = 'https://cep.dev/accounts/applications/googledrive/oauth2/'
auth_url, state = flow.authorization_url(access_type='offline')
Expand Down Expand Up @@ -83,7 +84,8 @@ def oauth2_callback(request):
redirect_uri = reverse('googledrive_integration:oauth2_callback')
flow = google_auth_oauthlib.flow.Flow.from_client_config(
get_client_config(),
scopes=['https://www.googleapis.com/auth/drive', ],
scopes=['https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive.appdata'],
state=state)
flow.redirect_uri = 'https://{}{}'.format(request.get_host(), redirect_uri)

Expand Down

0 comments on commit e0a4efb

Please sign in to comment.