How to get IMAP Access Token

Marshall Wan || Covertech 0 Reputation points

Hi everyone,

I tried to get IMAP Access Token via Azure AD, but I failed.

I'm still new to this Oauth 2.0 stuff, so I did some research, and according to this YT video, I have followed what was taught, and somehow I still have to get the Access Token.

Any help would be appreciated, thanks in advance.



Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,990 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
18,693 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Harpreet Singh Matharoo 7,376 Reputation points Microsoft Employee

    Hello @Marshall Wan || Covertech

    Thank you for reaching out. While I am not expert on IMAP and Exchange based auth, however I assume following document should help you resolve your issue: Authenticate an IMAP, POP or SMTP connection using OAuth

    You can also check following QnA post on which similar question was answered: [

    I hope this answer helps to resolve your issue.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

  2. Akshay-MSFT 14,956 Reputation points Microsoft Employee

    Hello @Marshall Wan || Covertech ,

    Thank you for posting your on Q&A. The video link you shared is using POSTMAN to get access token for IMAP. You could follow Get an access token for getting the access token in same way.

    Within above doc there are 3 ways, of which I would recommend to use OAuth2 authorization code flow.

    1. Auth URL and Access Token URL
    2. User's image
      1. Client ID User's image
    3. Client Secret value, if you don't have one the please generate by clicking on +New Client Secret User's image
    4. Scope must be and a similar permission must be added




    User's image

    • Fill all details in POSTMAN as per below screenshot:
    • User's image
    • Hit "Get New Access Token" and authenticate with your crop credentials (any user assigned to the IMAP app registered in Azure AD)

    Please do let me know if you have any further queries.


    Akshay Kaushik

    Please "Accept the answer", "Upvote" and share your feedback (Yes/No) if the suggestion works as per your business need. This will help us and others in the community as well.