擅长:python、mysql、java
<p>根据<a href="https://pypi.org/project/O365/#authentication" rel="nofollow noreferrer">docs</a>,当您验证</strong>时,您的令牌将存储在指定的路径<strong>。在</p>
<p>第一次验证后,令牌将在指定的路径上读取。当您使用指向此路径的令牌后端创建和帐户时,此帐户将自动登录。在</p>
<pre><code>token_backend = FileSystemTokenBackend(token_path='token_dir', token_filename='o365_token.txt')
account = Account(CREDENTIALS, token_backend=token_backend)
# If it's your first login, you will have to visit a website to authenticate and paste the redirected URL in the console. Then your token will be stored.
# If you already have a valid token stored, then account.is_authenticated is True.
if not account.is_authenticated:
account.authenticate(scopes=['basic', 'message_all'])
</code></pre>