How to get Client Secret Expiry details through an API

Sreeni G 0 Reputation points
2023-01-11T14:58:50.2166667+00:00

Hello,

I'm new to Azure API Management and as you may know that client secret expiry can be extended to only 2 years.

Now, I wanted to pull the expiry information through an API.

Example: I will call Azure API based on client id, so that Azure gives me the Expiry details of given client id. Could someone please help with this? Thanks in advance.

Regards,

Sreeni

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,904 questions
{count} votes

1 answer

Sort by: Most helpful
  1. TP 101.9K Reputation points
    2023-01-11T17:17:40.2266667+00:00

    Hi Sreeni,

    You can use below Get application in Microsoft Graph to retrieve the application object. To find the expiration you need to examine PasswordCredentials and passwordCredential's EndDateTime property.

    Get application

    https://learn.microsoft.com/en-us/graph/api/application-get?view=graph-rest-1.0&tabs=http

    passwordCredential resource type

    https://learn.microsoft.com/en-us/graph/api/resources/passwordcredential?view=graph-rest-1.0#properties

    application resource type

    https://learn.microsoft.com/en-us/graph/api/resources/application?view=graph-rest-1.0

    If the above was useful, please Accept Answer.

    Thanks

    -TP

    1 person found this answer 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.