Guest User

Untitled

a guest
Oct 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. auth_string = 'user=%s1auth=Bearer %s11' % (email, access_token)
  2. imap_conn = imaplib.IMAP4_SSL('imap-mail.outlook.com')
  3. imap_conn.debug = 4
  4. imap_conn.authenticate('XOAUTH2', lambda x: auth_string)
  5. imap_conn.select('INBOX')
  6. print(imap_conn.list())
  7.  
  8. { 'access_token': '****',
  9. 'scope': 'User.Read Mail.Send Mail.ReadWrite',
  10. 'refresh_token': '***',
  11. 'token_type': 'Bearer',
  12. 'ext_expires_in': 0,
  13. 'expires_in': 3600
  14. }
  15.  
  16. 46:15.27 > b'JEKB1 AUTHENTICATE XOAUTH2'
  17. 46:15.57 < b'+ '
  18. 46:15.57 write literal size 1584
  19. 46:21.21 < b'JEKB1 NO AUTHENTICATE failed.'
  20. 46:21.21 NO response: b'AUTHENTICATE failed.'
Add Comment
Please, Sign In to add comment