How to check connectivity to token endpoints programmatically ?

Himan Jo 1 Reputation point
2022-05-24T22:08:15.23+00:00

Hello team,

How can the app running on Android confirm if the Azure AD app / token endpoint, etc. is reachable ?

The app needs to check if it can communicate with the Azure AD app or other azure services before making a call to it. Is there a functionality like ping or something similar which can be used to confirm the connectivity ? Is there a MS Graph API to achieve this ?

The app needs to check for connectivity status continuously so authenticating user or the like wouldn't be an ideal approach.

Thank you in advance.

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

1 answer

Sort by: Most helpful
  1. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,526 Reputation points Moderator
    2022-05-25T03:42:36.313+00:00

    Hello himanjo-2471, Azure AD identity endpoints are guaranteed to be available 99.99% of the time, however if you want to ensure the endpoints are reachable from your network you can send a OPTIONS HTTP request to the OpenID Connect discovery document https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration and optionally to the endpoints listed in it (You need to execute a GET request) like the token endpoint https://login.microsoftonline.com/common/oauth2/v2.0/token.

    If you want to ping tenant specifc endpoints just replace the common part with the tenant id or name. Eg: https://login.microsoftonline.com/<TENANT ID OR NAME EG. MYTENANT.ONMICROSOFT.COM>/v2.0/.well-known/openid-configuration

    Let us know if this answer was helpful to you or if you need additional assistance. If it was helpful, please remember to accept it so that others in the community with similar questions can more easily find a solution.


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.