python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

How to obtain the authenticated user email?

Open pabsta1 opened this issue 3 years ago • 1 comments

Have I read the documentation too fast, or there is no way to obtain the email address from the Account() object? I see the get_current_user() method, but it only provides the name.

This is not central, has messages can be sent without it, but it would be a natural "nice to have".

(Don't get me wrong: I'm a big fan of your library! It is very useful to build connectors.)

Edit: it can be found with a bit of tweaking:

user = account.get_current_user()
user.__dict__["mail']

pabsta1 avatar Jul 19 '21 07:07 pabsta1

user.mail should work.....

alejcas avatar Sep 03 '21 09:09 alejcas