Santhakumar
(Shantha Kumar)
November 19, 2024, 11:39am
1
Hi All,
I have an requirement to call the RevokeSignInSession API from microsoft graph API to revoke the sessions for Entra ID users. I have tried the below api call but it’s failing the Token Generation.
Content-Type: application/x-www-form-urlencoded
Given the Body as form-data, but in postman it was x-www-form-urlencoded. Does this cause any problem???
Any idea how to trigger this in ISC?
Thanks.
2 Likes
jesvin90
(Jesvin Joseph)
November 19, 2024, 1:39pm
2
Hi @Santhakumar ,
Try this with method as POST. I don’t think you need to pass anything in the body.
1 Like
Santhakumar
(Shantha Kumar)
November 19, 2024, 2:02pm
3
@jesvin90 Tried but getting Request Failed error
3 Likes
zachm117
(Zach Mullins)
November 19, 2024, 2:19pm
4
Hey @Santhakumar ,
For your body, can you try replacing the ‘resource’ key with ‘scope’ and replacing its value with ‘https://graph.microsoft.com/.default ’.
This is from the Microsoft documentation on getting a token.
Please let me know if this helps!
Santhakumar
(Shantha Kumar)
November 19, 2024, 2:45pm
5
Tried this but still get an error.
2 Likes
zachm117
(Zach Mullins)
November 19, 2024, 2:54pm
6
Here are some screenshots of one I used to create an interactive workflow for creating Entra groups. The fields should be the same for whatever you are looking to accomplish, just potentially with a different Request URL and Request Body.
Thank you,
Santhakumar
(Shantha Kumar)
November 19, 2024, 4:04pm
7
The method i have trying to achieve is Get but even i deleted the HTTP Request multiple times and recreated it doesn’t work…
Deleted the whole WF and recreated but still same Request Failed error.
2 Likes
Santhakumar
(Shantha Kumar)
November 19, 2024, 4:09pm
8
Here is the WF i have used. Can anyone tell what’s the difference??
EntraIDWF20241119.json (2.1 KB)
1 Like
zachm117
(Zach Mullins)
November 19, 2024, 4:22pm
9
Looks about the same to the working one I have setup.
Did you try this in Postman to confirm the tenantId, clientId, and clientSecret are correct and have the correct permissions?
Thank you,
Santhakumar
(Shantha Kumar)
November 19, 2024, 4:29pm
10
Yes through postman i was able to generate the access token, but through WF it’s not works.
1 Like
jesvin90
(Jesvin Joseph)
November 19, 2024, 4:43pm
11
Hi @Santhakumar ,
The WF works in my tenant. Have you tried using the token to make the same call in postman.?
Looks like your error is not in retrieving the token, but in the actual get call.
Santhakumar
(Shantha Kumar)
November 19, 2024, 4:44pm
12
I was able to do it via postman it only fails through ISC WF UI
1 Like
Santhakumar
(Shantha Kumar)
November 19, 2024, 4:56pm
13
If i gave the token directly and try the Get user endpoint it’s work but not through auto token retrieval. Any idea why this is occurs?? Or it’s a bug/something…
Thanks.
zachm117
(Zach Mullins)
November 19, 2024, 5:36pm
14
Can you get a copy of the execution report and attach it here (after sanitizing it of course)? Exit the workflow, click on its name, switch to the Executions tab in the right side popup, and download the execution report for your latest run. I can explain this better if needed. Even for tests and not actual runs, the execution report should still be available and might have some more information to help troubleshoot this issue.
Example:
Thank you,
Santhakumar
(Shantha Kumar)
November 19, 2024, 6:50pm
15
Below is the error i have seen in Downloaded Execution File
{"error":"task failed: activity error (type: sp:external:http:v2, scheduledEventID: 23, startedEventID: 24, identity: 1@sp-workflow-worker-internal-5ff6946d57-qgprh@): request failed (type: HTTP Response Returned a Client Error, retryable: false): request failed: 401 - 401 Unauthorized - {\"error\":{\"code\":\"InvalidAuthenticationToken\",\"message\":\"Access token validation failure. Invalid audience.\",\"innerError\":{\"date\":\"2024-11-19T16:12:06\",\"request-id\":\"98ff964b-14a6-43f7-a343-bc456c93a986\",\"client-request-id\":\"98ff964b-14a6-43f7-a343-bc456c93a986\"}}}"}
zachm117
(Zach Mullins)
November 19, 2024, 7:01pm
16
Thanks @Santhakumar !
Try updating your Token URL to this (adding the v2.0): https://login.microsoftonline.com/{{tenant}}/oauth2/v2.0/token
Thank you,
Santhakumar
(Shantha Kumar)
November 19, 2024, 7:23pm
17
Does it need to be configure anywhere to use this v2.0? Because I have tried In my local it throws an error…
zachm117
(Zach Mullins)
November 19, 2024, 8:11pm
18
I am not entirely sure. I found this Microsoft article that has the same error you are getting and that was the resolution through Postman.
Santhakumar
(Shantha Kumar)
November 20, 2024, 12:12pm
19
Tried the method you mentioned in the document but getting below error:
zachm117
(Zach Mullins)
November 20, 2024, 1:42pm
20
Hi Shantha,
Resource is not a valid parameter and should instead be scope with the value of “https://graph.microsoft.com/.default ”
Thank you,