You can only authenticate using oauth athentication as Microsoft deprecated basic auth on November 1st 2018. # now we are autheticated # use the library from now on #. is_authenticated: # will check if there is a token and has not expired # ask for a login # console based authentication See Authentication for other flows account. Scopes = # you can use scope helpers here (see Permissions and Scopes section) account = Account( credentials) With the access token retrieved and stored you will be able to perform api calls to the service.Ī common pattern to check for authentication and use the library is this one: Otherwise the library will only have access to the user resources for 1 hour. It is highly recommended to add the "offline_access" permission and request this scope when authenticating. The first step to be able to work with this library is to register an application and retrieve the auth token.
Simply run pip install O365 to install it.
body = "George Best quote: I've stopped drinking, but only while I'm asleep." m.
From O365 import Account credentials = ( 'client_id', 'client_secret')