graph url scopes not supported for smtp and imap

%3CLINGO-SUB%20id%3D%22lingo-sub-1944017%22%20slang%3D%22en-US%22%3Egraph%20url%20scopes%20not%20supported%20for%20smtp%20and%20imap%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1944017%22%20slang%3D%22en-US%22%3E%3CP%3EFor%20authentication%2C%20we%20are%20using%20below%20scopes%20as%20mentioned%20in%20the%20doc%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fclient-developer%2Flegacy-protocols%2Fhow-to-authenticate-an-imap-pop-smtp-application-by-using-oauth%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fclient-developer%2Flegacy-protocols%2Fhow-to-authenticate-an-imap-pop-smtp-application-by-using-oauth%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CPRE%3Eoffline_access%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Foutlook.office.com%2FIMAP.AccessAsUser.All%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Foutlook.office.com%2FIMAP.AccessAsUser.All%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Foutlook.office.com%2FSMTP.Send%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Foutlook.office.com%2FSMTP.Send%3C%2FA%3E%3C%2FPRE%3E%3CP%3EWe%20are%20able%20to%20get%20access_token%20and%20refresh_token%20successfully%3CBR%20%2F%3EWe%20want%20get%20%3CSTRONG%3EuserPrincipalName%3C%2FSTRONG%3E%20using%20graph%20api%26nbsp%3B%3CSTRONG%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%3C%2FA%3E%3CBR%20%2F%3E%3C%2FSTRONG%3Ehowever%20we%20are%20getting%20error%20%2C%20looks%20like%20for%20hitting%20graph%20api%20only%20graph%20scopes%20would%20work.%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20tried%20with%20graph%20scopes%20urls%2C%3C%2FP%3E%3CPRE%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2FIMAP.AccessAsUser.All%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2FIMAP.AccessAsUser.All%3C%2FA%3E%20%2C%20%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2FSMTP.Send%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2FSMTP.Send%3C%2FA%3E%20%3C%2FPRE%3E%3CP%3Eand%20able%20to%20hit%20graph%20api%20%2C%20however%20smtp%20and%20imap%20authentication%20is%20not%20working%20with%20these%20scopes.%3CBR%20%2F%3E%3CBR%20%2F%3Esince%20Microsoft%20is%20deprecating%20outlook%20rest%20apis%20and%20asking%20to%20move%20to%20graph%20api%3CBR%20%2F%3Ethen%20why%20graph%20scopes%20urls%20are%20not%20supported%20for%20SMTP%20and%20IMAP%20%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1944017%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIMAP%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20Graph%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESMTP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

For authentication, we are using below scopes as mentioned in the doc
https://docs.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-i...

offline_access
https://outlook.office.com/IMAP.AccessAsUser.All
https://outlook.office.com/SMTP.Send

We are able to get access_token and refresh_token successfully
We want get userPrincipalName using graph api https://graph.microsoft.com/v1.0/me
however we are getting error , looks like for hitting graph api only graph scopes would work.

We tried with graph scopes urls,

https://graph.microsoft.com/IMAP.AccessAsUser.All , https://graph.microsoft.com/SMTP.Send 

and able to hit graph api , however smtp and imap authentication is not working with these scopes.

since Microsoft is deprecating outlook rest apis and asking to move to graph api
then why graph scopes urls are not supported for SMTP and IMAP ?

0 Replies