Testing the authentication functionality using a JWT token

You should have the following ready to test the functionality using Postman:

  1. OAuth 2.0 token endpoint, you can get this in the Endpoints tab of Azure AD and grab the URL:
    • Grant type: A hardcoded client_credentials value.
    • Client ID of the client application: You noted it in the fourth step of the Registering the client app in Azure AD section.
    • Key that you generated for your client application: You noted it in the fifth step of the Registering the client app in Azure AD section.
    • Resource: Resource to which we need to access. It's the client ID of the backend application; you noted it in the fourth step of the Configuring Azure AD to the function app section.
  2. Once you have all that information, you need to pass all the parameters and make a call to an Azure AD tenant, which returns the bearer token as follows:

  1. The next and final step is to make a call to the actual backend (the Azure Function HTTP trigger) by passing the bearer JWT token (access_token) that we copied from the preceding screen:

  1. As shown in this screenshot, add an Authorization header and paste the JWT token. Don't forget to provide the text bearer word.