它不会在 txt python-O365 中生成 refresh_token

No genera el refresh_token en txt python-O365

我正在使用 python 的 o365 库,当我通过 account.con.request_token(result_url) 生成 txt 时,它不会生成 refresh.token 它只是生成access_token,这是我的代码

from O365 import Account

scopes_graph = protocols.get_scopes_for('message_send')
credential = ('client_id', 'client_secret')

account = Account(credentials=credential, scopes=scopes_graph)
account.con.get_authorization_url()
result_url = input('Paste the result url here...')
#'aqui crea el txt pero no genera el 
account.con.request_token(result_url) 
m = account.new_message() 
m.to.add('examples@example.com')
m.subject = 'Testing!'
m.body = "George Best quote: I've stopped drinking, but only while I'm asleep."
m.send()

我需要 "refresh_token":"...." 谢谢

只需要用到:

改变这个:

account = Account(credentials=credential, scopes=scopes_graph)
account.con.get_authorization_url()
result_url = input('Paste the result url here...')
#'aqui crea el txt pero no genera el 
account.con.request_token(result_url)

通过此代码

account = Account(credentials=credential, scopes=scopes_graph)
account.authenticate(scopes=['basic', 'message_all'])