python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

Fix scopes process of get_authorization_url

Open obsd opened this issue 4 years ago • 1 comments

The function get_authorization_url is passing scopes to get_session without process, so you get an error that there aren't such scopes. You can see here how the scopes look like before the fix and compare them to the scopes that did work:

print(requested_scopes, self.scopes)
['basic', 'message_all'] ['https://graph.microsoft.com/Mail.ReadWrite', 'https://graph.microsoft.com/Mail.Send', 'offline_access', 'https://graph.microsoft.com/User.Read']

and after the fix:

protocol = MSGraphProtocol()
protocol.get_scopes_for(requested_scopes)
['https://graph.microsoft.com/Mail.ReadWrite', 'https://graph.microsoft.com/Mail.Send', 'offline_access', 'https://graph.microsoft.com/User.Read']

obsd avatar Feb 18 '21 14:02 obsd

@janscas can you review it?

odedvisiblerisk avatar Feb 22 '21 08:02 odedvisiblerisk