python-o365
python-o365 copied to clipboard
Fix scopes process of get_authorization_url
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']
@janscas can you review it?