Revoke Access Token Service to Service Authentication

Imtiaz Khadim 1 Reputation point
2022-05-30T06:52:31.81+00:00

Hi All,

I am using service to service authentication, I get the access token in my daemon service using OAuth 2.0 Client Credential flow using following end point
https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token

Now my service wants to invalidate or logout the token how can I achieve this. Please help me on this. What is the token revoke end point? Is it possible if not please provide some feedback as I can get and revoke token with other CRM Platforms like Salesforce.

Regards,
IK

Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Manu Philip 20,206 Reputation points MVP Volunteer Moderator
    2022-05-30T08:04:18.85+00:00

    Dynamics 365 API tokens can be revoked by calling DELETE /login/refreshToken?refreshToken={refresh_token_value} HTTP/1.1

    Example:

    DELETE https://mrs.contoso.com/login/refreshToken?refreshToken=ScW2t HTTP/1.1
    

    Also, visit the documentation page: deployr-api-docs


    --please don't forget to upvote and Accept as answer if the reply is helpful--

    1 person found this answer helpful.

  2. Manu Philip 20,206 Reputation points MVP Volunteer Moderator
    2022-05-30T07:07:57.94+00:00

    Note that, 'Access tokens cannot be revoked and are valid until their expiry' Reference: https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-configurable-token-lifetimes#access-tokens
    However, you may revoke refresh tokens using Graph API. Application looses the token when you revoke refresh token and it helps. Following POST command will revoke the refresh token

    POST https://graph.microsoft.com/v1.0/me/revokeSignInSessions  
    

    ----------

    --please don't forget to upvote and Accept as answer if the reply is helpful--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.