Using confidential client application example to obtain OAuth2 token and sending email via SMTP

Frequent Visitor

Hello All,

 

I am trying to use the confidential client MSAL example to obtain a bearer token and then login to exchange using xoauth2. The example is available here:

https://github.com/AzureAD/microsoft-authentication-library-for-python/blob/dev/sample/confidential_...

 

I am able to obtain the access token but authentication to exchange is always un-successful. Due to the nature of this grant (client grant), the scope used is https://graph.microsoft.com/.default. However, in the application api permissions on azure portal, I have added SMTP.Send.

 

I'd appreciate if someone can help me whether the confidential client application can be used in this manner. I've also tried public client application with device flow, but the result is still the same.

 

Arshad

0 Replies