Skip to content

Commit 80dba90

Browse files
author
Alejandro Casanovas
committed
Fix for O365#669 - added ValueError when using auth flow type credentials and providing scopes
1 parent ddd7b52 commit 80dba90

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

O365/account.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ def __init__(self, credentials, *, protocol=None, main_resource=None, **kwargs):
3535
if scopes is not None:
3636
kwargs['scopes'] = self.protocol.get_scopes_for(scopes)
3737
elif auth_flow_type == 'credentials':
38-
# for client credential grant flow solely:
39-
# append the default scope if it's not provided
38+
# for client credential grant flow solely: add the default scope if it's not provided
4039
if not scopes:
4140
kwargs['scopes'] = [self.protocol.prefix_scope('.default')]
41+
else:
42+
raise ValueError('Auth flow type "credentials" does not require scopes')
4243

4344
# set main_resource to blank when it's the 'ME' resource
4445
if self.protocol.default_resource == ME_RESOURCE:

0 commit comments

Comments
 (0)