In the following post I will describe how to implement an Oauth 2.0 authentication in a Logic App
Registration APP creation (reserved for the TENANT administrator).
From the Azure Active Directory create a new Registration App
Assign a name to the registration App and register it:
Once created, create a new certificate and secret:
Once created save the contents of the VALUE field (upon creation it will be shown, afterwards it will not be shown in full) :
Annotate the following values to generate the Beare Token at the following URL:
REST API to generate OAuth tokens along with the secret value noted earlier:
Below is an example from Postman to invoke the Bearer Token:
URL: https://login.microsoftonline.com/{tenantId}/oauth2/token
Verb: POST
Parameters:
Client_Secret: client secret collected in App registration
grant_type: client_credentials
client_id : Application Id of App registration
resource: https://management.azure.com
Retrieve Audience and Issuer from https://jwt.ms/
Once the token is retrieved from Postman, go to the url https://jwt.ms/ to retrieve the Issuer and Audience values that will later be set in the Logic App:
Enter the TOKEN as in the image:
Note the following values in yellow:
Aud = AUDIENCE
Iss= ISSUER
Create Logic App With Permissions
In the Permissions section, create a new policy as in the image by entering the values retrieved from JWT.ms.
Pay attention to the ISSUER, it is also important to report the final slash
Call up the trigger URL by modifying it like this:
as is:
https://prod-196.westeurope.logic.azure.com:443/workflows/24f9ea1cc3a74e5180fXXXXXXX8/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=JgggvgaA6puQE4K3hvX_nhgvm6ooKLZabvK6xdykf-A
To Be:
https://prod-196.westeurope.logic.azure.com:443/workflows/24f9ea1cc3XXXXXXXXX5e8/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0
Removing the primary key SAS authentication part:
&sig=JgggvgaA6puQE4K3hvX_nhgvm6ooKLZabvK6xdykf-A
POSTMAN EXAMPLE
the game is done!