locked
How do i know access token of outlook expired? RRS feed

  • Question

  • How do i know access token of outlook has expired? 

    If it expires now, the following message appears.

    Error Occured: 500 5.3.3 Unrecognized command 'unknown' [TYCPR01CA0120.jpnprd01.prod.outlook.com]

    Tuesday, August 25, 2020 5:28 AM

All replies

  • Hi Hwan,

    Thank you for posting here.

    I didn't find any information about the expiration of Outlook's access token, but I found some posts with the same problem of "500 5.3.3 Unrecognized command'unknown'", please see if it helps you.

    Exchange 2010 SP3 - "500 5.3.3 Unrecognized command" in SMTP Receive Log. Senders get message with the same problem

    500 5.3.3 unrecognized command issue

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 25, 2020 7:47 AM
  • Graph API provides two authentication flow:

    1. Get access on behalf of a user
    2. Get access without a user
    If you want to run the Outlook API in background service(not all app need user signed-in, based on actual demand), you can use the authentication flow #2. By using this way, end user do not need to request Token explicitly, so it look like permanent access token, until the Microsoft/Azure need the admin consent again.

    If you want to run the Outlook API just for signed-in user, you can use the authentication flow #1. After get an access Token, store the access Token and Refresh Token in the Token-cache and use the refresh Token to request new Token while the access token lifetime expires. If both access/refresh token have expired, the user need to sign-in again to re-grant permission.
    Tuesday, August 25, 2020 1:47 PM
  • Depends on how you got that access token but most likely it is a bearer token from OAuth. Therefore the token contains an "expires in" value that tells you how long it is good for. Before that time expires you have to refresh the token to keep using it.

    If you're instead using a personal access token (PAT) then I don't know that you can tell as it is encoded value. It just expires at some point. Never really looked into figuring out how to tell if a PAT is expired or not.


    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, August 25, 2020 1:51 PM